Ejabberd uses the http 404 code in a handful of cases. You can find them in the source, and the comments are reasonably exaplanatory:
emancipator:xmpp-server grib$ grep -3 -in 404 src/web/ejabberd_http_bind.erl
228- {size_limit, Sid} ->
229- case mnesia:dirty_read({http_bind, Sid}) of
230- [] ->
231: {404, ?HEADER, ""};
232- [#http_bind{pid = FsmRef}] ->
233- gen_fsm:sync_send_all_state_event(FsmRef, {stop, close}),
234- {200, ?HEADER, "<body type='terminate' "
--
780- case http_put(Sid, Rid, Attrs, Payload, PayloadSize, StreamStart, IP) of
781- {error, not_exists} ->
782- ?DEBUG("no session associated with sid: ~p", [Sid]),
783: {404, ?HEADER, ""};
784- {{error, Reason}, Sess} ->
785- ?DEBUG("Error on HTTP put. Reason: ~p", [Reason]),
786- handle_http_put_error(Reason, Sess);
--
853- case Reason of
854- not_exists -> %% bad rid
855- ?DEBUG("Closing HTTP bind session (Bad rid).", []),
856: {404, ?HEADER, ""};
857- bad_key ->
858- ?DEBUG("Closing HTTP bind session (Bad key).", []),
859: {404, ?HEADER, ""};
860- polling_too_frequently ->
861- ?DEBUG("Closing HTTP bind session (User polling too frequently).", []),
862- {403, ?HEADER, ""}
On Jan 28, 2013, at 10:49 AM, Bill Hubbard wrote:
I'm having the same issue, but using JSJaC, not Strophe. In my case, as in the example provided by Saurabh, I would get a 404 on the request that was attempting to send rid 91. What I don't understand is why the request shows up in the ejabberd log. How does a request get through to the log if it got a 404 response? I thought 404 meant the server could not be reached.