mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Wait for more data than just <stream:stream> before sending in bosh
This fixes issue #2545
This commit is contained in:
parent
ca022b6d1f
commit
1af2cf37ea
@ -365,15 +365,22 @@ wait_for_session(#body{attrs = Attrs} = Req, From,
|
|||||||
{State3, RespEls} = get_response_els(State2),
|
{State3, RespEls} = get_response_els(State2),
|
||||||
State4 = stop_inactivity_timer(State3),
|
State4 = stop_inactivity_timer(State3),
|
||||||
case RespEls of
|
case RespEls of
|
||||||
[] ->
|
[{xmlstreamstart, _, _} = El1] ->
|
||||||
State5 = restart_wait_timer(State4),
|
OutBuf = buf_in([El1], State4#state.el_obuf),
|
||||||
Receivers = gb_trees:insert(RID, {From, Resp},
|
State5 = restart_wait_timer(State4),
|
||||||
State5#state.receivers),
|
Receivers = gb_trees:insert(RID, {From, Resp},
|
||||||
{next_state, active,
|
State5#state.receivers),
|
||||||
State5#state{receivers = Receivers}};
|
{next_state, active,
|
||||||
_ ->
|
State5#state{receivers = Receivers, el_obuf = OutBuf}};
|
||||||
reply_next_state(State4, Resp#body{els = RespEls}, RID,
|
[] ->
|
||||||
From)
|
State5 = restart_wait_timer(State4),
|
||||||
|
Receivers = gb_trees:insert(RID, {From, Resp},
|
||||||
|
State5#state.receivers),
|
||||||
|
{next_state, active,
|
||||||
|
State5#state{receivers = Receivers}};
|
||||||
|
_ ->
|
||||||
|
reply_next_state(State4, Resp#body{els = RespEls}, RID,
|
||||||
|
From)
|
||||||
end;
|
end;
|
||||||
wait_for_session(_Event, _From, State) ->
|
wait_for_session(_Event, _From, State) ->
|
||||||
?ERROR_MSG("unexpected sync event in 'wait_for_session': ~p",
|
?ERROR_MSG("unexpected sync event in 'wait_for_session': ~p",
|
||||||
|
Loading…
Reference in New Issue
Block a user