From 51a55723cf8bdcc4112295f20ffa1f9a178cd81d Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 16 Jun 2009 17:45:50 +0000 Subject: [PATCH] Use DEBUG instead of INFO_MSG to keep log files small. Fix parse errors for grepping 'stream:error' (thanks to Stefan Strigler) SVN Revision: 2226 --- src/web/ejabberd_http_bind.erl | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/web/ejabberd_http_bind.erl b/src/web/ejabberd_http_bind.erl index 094e92793..f366a7c1a 100644 --- a/src/web/ejabberd_http_bind.erl +++ b/src/web/ejabberd_http_bind.erl @@ -4,12 +4,12 @@ %%% Purpose : Implements XMPP over BOSH (XEP-0205) (formerly known as %%% HTTP Binding) %%% Created : 21 Sep 2005 by Stefan Strigler -%%% Id : $Id: ejabberd_http_bind.erl 349 2007-08-30 13:39:57Z sstrigler $ +%%% Id : $Id: ejabberd_http_bind.erl 389 2007-09-25 15:27:44Z sstrigler $ %%%---------------------------------------------------------------------- -module(ejabberd_http_bind). -author('steve@zeank.in-berlin.de'). --vsn('$Rev: 349 $'). +-vsn('$Rev: 389 $'). -behaviour(gen_fsm). @@ -213,7 +213,7 @@ process_request(Data) -> %% {stop, StopReason} %%---------------------------------------------------------------------- init([Sid, Key]) -> - ?INFO_MSG("started: ~p", [{Sid, Key}]), + ?DEBUG("started: ~p", [{Sid, Key}]), Opts = [], % TODO ejabberd_socket:start(ejabberd_c2s, ?MODULE, {http_bind, self()}, Opts), % {ok, C2SPid} = ejabberd_c2s:start({?MODULE, {http_bind, self()}}, Opts), @@ -793,14 +793,12 @@ send_outpacket(#http_bind{pid = FsmRef}, OutPacket) -> case xml_stream:parse_element( ""++OutPacket) of El when element(1, El) == xmlelement -> - {xmlelement, _Tag, _Attr, Els} = El, - [{xmlelement, SE, _, Cond} | _] = Els, - if - SE == "stream:error" -> - Cond; - true -> - null - end; + case xml:get_subtag(El, "stream:error") of + false -> + null; + {xmlelement, _, _, Cond} -> + Cond + end; {error, _E} -> null end,