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

Merge branch 'master' of github.com:processone/ejabberd

This commit is contained in:
Christophe Romain 2015-09-18 09:06:51 +02:00
commit 497cbb3ec2
3 changed files with 15 additions and 3 deletions

View File

@ -335,6 +335,7 @@ init([Sid, Key, IP, HOpts]) ->
SOpts = lists:filtermap(fun({stream_managment, _}) -> true;
({max_ack_queue, _}) -> true;
({resume_timeout, _}) -> true;
({max_resume_timeout, _}) -> true;
({resend_on_timeout, _}) -> true;
(_) -> false
end, HOpts),

View File

@ -115,6 +115,7 @@ init([{#ws{ip = IP, http_opts = HOpts}, _} = WS]) ->
SOpts = lists:filtermap(fun({stream_managment, _}) -> true;
({max_ack_queue, _}) -> true;
({resume_timeout, _}) -> true;
({max_resume_timeout, _}) -> true;
({resend_on_timeout, _}) -> true;
(_) -> false
end, HOpts),

View File

@ -159,8 +159,13 @@ handle_call({starttls, TLSSocket}, _From,
c2s_pid = C2SPid,
max_stanza_size = MaxStanzaSize} = State) ->
close_stream(XMLStreamState),
NewXMLStreamState = xml_stream:new(C2SPid,
MaxStanzaSize),
NewXMLStreamState = case C2SPid of
undefined ->
XMLStreamState;
_ ->
xml_stream:new(C2SPid,
MaxStanzaSize)
end,
NewState = State#state{socket = TLSSocket,
sock_mod = p1_tls,
xml_stream_state = NewXMLStreamState},
@ -347,7 +352,12 @@ process_data(Data,
shaper_state = ShaperState, c2s_pid = C2SPid} =
State) ->
?DEBUG("Received XML on stream = ~p", [(Data)]),
XMLStreamState1 = xml_stream:parse(XMLStreamState, Data),
XMLStreamState1 = case XMLStreamState of
undefined ->
XMLStreamState;
_ ->
xml_stream:parse(XMLStreamState, Data)
end,
{NewShaperState, Pause} = shaper:update(ShaperState, byte_size(Data)),
if
C2SPid == undefined ->