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

Send trailer and close socket explicitly on stream end

This commit is contained in:
Evgeniy Khramtsov 2018-06-01 07:58:03 +03:00
parent 1261502f6a
commit 4fc8d1c4a4

View File

@ -459,8 +459,7 @@ process_invalid_xml(#{lang := MyLang} = State, El, Reason) ->
process_stream_end(_, #{stream_state := disconnected} = State) ->
State;
process_stream_end(Reason, State) ->
State1 = State#{stream_timeout => infinity,
stream_state => disconnected},
State1 = send_trailer(State),
try callback(handle_stream_end, Reason, State1)
catch _:{?MODULE, undef} -> stop(State1)
end.