25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

Removed debugging stuff. Removed error condition (thanks to Stefan Strigler)

SVN Revision: 2284
This commit is contained in:
Badlop 2009-06-16 18:25:14 +00:00
parent 7cb0b1a911
commit bf4e927142

View File

@ -3,12 +3,12 @@
%%% Author : Stefan Strigler <steve@zeank.in-berlin.de> %%% Author : Stefan Strigler <steve@zeank.in-berlin.de>
%%% Purpose : HTTP Binding support (JEP-0124) %%% Purpose : HTTP Binding support (JEP-0124)
%%% Created : 21 Sep 2005 by Stefan Strigler <steve@zeank.in-berlin.de> %%% Created : 21 Sep 2005 by Stefan Strigler <steve@zeank.in-berlin.de>
%%% Id : $Id: ejabberd_http_bind.erl 276 2007-08-15 16:09:23Z sstrigler $ %%% Id : $Id: ejabberd_http_bind.erl 277 2007-08-16 09:39:05Z sstrigler $
%%%---------------------------------------------------------------------- %%%----------------------------------------------------------------------
-module(ejabberd_http_bind). -module(ejabberd_http_bind).
-author('steve@zeank.in-berlin.de'). -author('steve@zeank.in-berlin.de').
-vsn('$Rev: 276 $'). -vsn('$Rev: 277 $').
-behaviour(gen_fsm). -behaviour(gen_fsm).
@ -160,23 +160,18 @@ process_request(Data) ->
V -> V V -> V
end, end,
XmppVersion = xml:get_attr_s("xmpp:version", Attrs), XmppVersion = xml:get_attr_s("xmpp:version", Attrs),
case catch mnesia:transaction( mnesia:transaction(
fun() -> fun() ->
mnesia:write( mnesia:write(
#http_bind{id = Sid, #http_bind{id = Sid,
pid = Pid, pid = Pid,
to = {XmppDomain, to = {XmppDomain,
XmppVersion}, XmppVersion},
hold = Hold, hold = Hold,
wait = Wait, wait = Wait,
version = Version version = Version
}) })
end) of end),
{'EXIT', Reason} ->
?DEBUG("failed storing session: ~p", [Reason]);
Foo ->
?DEBUG("foo: ~p", [Foo])
end,
handle_http_put(Sid, Rid, Attrs, Payload, true) handle_http_put(Sid, Rid, Attrs, Payload, true)
end; end;
{ok, {Sid, Rid, Attrs, Payload1}} -> {ok, {Sid, Rid, Attrs, Payload1}} ->
@ -609,14 +604,6 @@ receive_loop(Sess, Rid, Attrs, StreamStart) ->
prepare_response(#http_bind{id=Sid, wait=Wait, hold=Hold}=Sess, prepare_response(#http_bind{id=Sid, wait=Wait, hold=Hold}=Sess,
Rid, Attrs, StreamStart) -> Rid, Attrs, StreamStart) ->
case http_get(Sess, Rid) of case http_get(Sess, Rid) of
{error, not_exists} ->
case xml:get_attr_s("type", Attrs) of
"terminate" ->
{200, ?HEADER, "<body xmlns='"++?NS_HTTP_BIND++"'/>"};
_ ->
?DEBUG("no session associated with sid: ~s", [Sid]),
{404, ?HEADER, ""}
end;
{ok, keep_on_hold} -> {ok, keep_on_hold} ->
receive_loop(Sess, Rid, Attrs, StreamStart); receive_loop(Sess, Rid, Attrs, StreamStart);
{ok, cancel} -> {ok, cancel} ->