25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Reset XML stream before sending SASL <success/>

This commit is contained in:
Evgeniy Khramtsov 2017-01-17 22:06:26 +03:00
parent 22ee16fd9d
commit b8db0a8ed6

View File

@ -809,6 +809,7 @@ process_sasl_success(Props, ServerOut,
mod := Mod, sasl_mech := Mech} = State) -> mod := Mod, sasl_mech := Mech} = State) ->
User = identity(Props), User = identity(Props),
AuthModule = proplists:get_value(auth_module, Props), AuthModule = proplists:get_value(auth_module, Props),
SockMod:reset_stream(Socket),
State1 = send_pkt(State, #sasl_success{text = ServerOut}), State1 = send_pkt(State, #sasl_success{text = ServerOut}),
case is_disconnected(State1) of case is_disconnected(State1) of
true -> State1; true -> State1;
@ -819,7 +820,6 @@ process_sasl_success(Props, ServerOut,
case is_disconnected(State2) of case is_disconnected(State2) of
true -> State2; true -> State2;
false -> false ->
SockMod:reset_stream(Socket),
State3 = maps:remove(sasl_state, State3 = maps:remove(sasl_state,
maps:remove(sasl_mech, State2)), maps:remove(sasl_mech, State2)),
State3#{stream_id => new_id(), State3#{stream_id => new_id(),