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

exmpp fixes in receiver (thanks to Karim Gemayel)

SVN Revision: 2932
This commit is contained in:
Badlop 2010-01-27 18:53:43 +00:00
parent a10493976e
commit f5e1479afe

View File

@ -288,14 +288,14 @@ activate_socket(#state{socket = Socket,
ok ok
end. end.
%% Data processing for connectors directly generating xmlelement in %% Data processing for connectors directly generating xmlel in
%% Erlang data structure. %% Erlang data structure.
%% WARNING: Shaper does not work with Erlang data structure. %% WARNING: Shaper does not work with Erlang data structure.
process_data([], State) -> process_data([], State) ->
activate_socket(State), activate_socket(State),
State; State;
process_data([Element|Els], #state{c2s_pid = C2SPid} = State) process_data([Element|Els], #state{c2s_pid = C2SPid} = State)
when element(1, Element) == xmlelement; when element(1, Element) == xmlel;
element(1, Element) == xmlstreamstart; element(1, Element) == xmlstreamstart;
element(1, Element) == xmlstreamelement; element(1, Element) == xmlstreamelement;
element(1, Element) == xmlstreamend -> element(1, Element) == xmlstreamend ->
@ -330,12 +330,12 @@ process_data(Data,
shaper_state = NewShaperState}, HibTimeout}. shaper_state = NewShaperState}, HibTimeout}.
%% Element coming from XML parser are wrapped inside xmlstreamelement %% Element coming from XML parser are wrapped inside xmlstreamelement
%% When we receive directly xmlelement tuple (from a socket module %% When we receive directly xmlel tuple (from a socket module
%% speaking directly Erlang XML), we wrap it inside the same %% speaking directly Erlang XML), we wrap it inside the same
%% xmlstreamelement coming from the XML parser. %% xmlstreamelement coming from the XML parser.
element_wrapper(XMLElement) element_wrapper(XmlEl)
when element(1, XMLElement) == xmlelement -> when element(1, XmlEl) == xmlel ->
{xmlstreamelement, XMLElement}; {xmlstreamelement, XmlEl};
element_wrapper(Element) -> element_wrapper(Element) ->
Element. Element.