From c90791569540391f2c72fb4a9972cde5d6eef842 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Mon, 25 Jun 2018 14:46:31 +0300 Subject: [PATCH] Intercept EXIT signal --- src/xmpp_stream_out.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/xmpp_stream_out.erl b/src/xmpp_stream_out.erl index 6cf762025..3e777a7e9 100644 --- a/src/xmpp_stream_out.erl +++ b/src/xmpp_stream_out.erl @@ -415,6 +415,8 @@ handle_info({tcp_closed, _}, State) -> handle_info({'$gen_event', closed}, State); handle_info({tcp_error, _, Reason}, State) -> noreply(process_stream_end({socket, Reason}, State)); +handle_info({'EXIT', _, Reason}, State) -> + {stop, Reason, State}; handle_info(Info, State) -> noreply(try callback(handle_info, Info, State) catch _:{?MODULE, undef} -> State