From 20a60d8bbfd16711ea05d51067927e959d6f5180 Mon Sep 17 00:00:00 2001 From: Christopher tofu Zorn Date: Wed, 28 Apr 2010 12:26:49 -0400 Subject: [PATCH] make sure we handle errors and not send old results --- src/web/ejabberd_http_pre_bind.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/web/ejabberd_http_pre_bind.erl b/src/web/ejabberd_http_pre_bind.erl index 33f31fd..c0b5c4f 100644 --- a/src/web/ejabberd_http_pre_bind.erl +++ b/src/web/ejabberd_http_pre_bind.erl @@ -29,11 +29,11 @@ handle_http_put(Sid, Rid, Attrs, Payload, PayloadSize, StreamStart, IP) -> case ejabberd_http_bind:http_put(Sid, Rid, Attrs, Payload, PayloadSize, StreamStart, IP) of {error, not_exists} -> ?DEBUG("no session associated with sid: ~p", [Sid]), - {404, ?HEADER, ""}; + {error, not_exists}; {{error, Reason}, _Sess} -> ?DEBUG("Error on HTTP put. Reason: ~p", [Reason]), %% ignore errors - {200, ?HEADER, ""}; + {ok, []}; {{wait, Pause}, _Sess} -> ?DEBUG("Trafic Shaper: Delaying request ~p", [Rid]), timer:sleep(Pause), @@ -41,11 +41,12 @@ handle_http_put(Sid, Rid, Attrs, Payload, PayloadSize, StreamStart, IP) -> StreamStart, IP); {buffered, _Sess} -> ?DEBUG("buffered", []), - {200, ?HEADER, ""}; + {ok, []}; {ok, Sess} -> handle_response(Sess, Rid); Out -> - ?ERROR_MSG("Handle Put was invalid : ~p ~n", [Out]) + ?ERROR_MSG("Handle Put was invalid : ~p ~n", [Out]), + {error, undefined} end. @@ -87,7 +88,6 @@ handle_auth(Sid, Rid, []}}]} -> Rid; {ok, _Els} -> - error_logger:info_msg("Auth Success? ~p ~n", [_Els]), timer:sleep(100), handle_auth(Sid, Rid+1, Attrs, Payload, PayloadSize, StreamStart, IP, Count+1);