]> granicus.if.org Git - ejabberd/commitdiff
Reset XML stream before sending SASL <success/>
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 17 Jan 2017 19:06:26 +0000 (22:06 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 17 Jan 2017 19:06:26 +0000 (22:06 +0300)
src/xmpp_stream_in.erl

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