From 4fc8d1c4a4c61ab9a9e59697bf1072cbc2135461 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Fri, 1 Jun 2018 07:58:03 +0300 Subject: [PATCH] Send trailer and close socket explicitly on stream end --- src/xmpp_stream_out.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xmpp_stream_out.erl b/src/xmpp_stream_out.erl index da0a14e22..bff50d30d 100644 --- a/src/xmpp_stream_out.erl +++ b/src/xmpp_stream_out.erl @@ -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.