25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-12 15:57:31 +01:00

Resend stream header before calling handle_auth_success/2 callback

This commit is contained in:
Evgeniy Khramtsov 2017-02-28 10:12:11 +03:00
parent 7a186e242d
commit f3594ec881

View File

@ -624,18 +624,18 @@ process_cert_verification(State) ->
process_sasl_success(#{mod := Mod, process_sasl_success(#{mod := Mod,
sockmod := SockMod, sockmod := SockMod,
socket := Socket} = State) -> socket := Socket} = State) ->
State1 = try Mod:handle_auth_success(<<"EXTERNAL">>, State)
catch _:undef -> State
end,
case is_disconnected(State1) of
true -> State1;
false ->
SockMod:reset_stream(Socket), SockMod:reset_stream(Socket),
State2 = State1#{stream_id => new_id(), State1 = State#{stream_id => new_id(),
stream_restarted => true, stream_restarted => true,
stream_state => wait_for_stream, stream_state => wait_for_stream,
stream_authenticated => true}, stream_authenticated => true},
send_header(State2) State2 = send_header(State1),
case is_disconnected(State2) of
true -> State2;
false ->
try Mod:handle_auth_success(<<"EXTERNAL">>, State2)
catch _:undef -> State2
end
end. end.
-spec process_sasl_failure(sasl_failure(), state()) -> state(). -spec process_sasl_failure(sasl_failure(), state()) -> state().