aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2017-11-15 01:11:37 +0100
committerHolger Weiss <holger@zedat.fu-berlin.de>2017-11-15 01:11:37 +0100
commitaf49472373bf31d4cf5a04847e882f1c82e6eaac (patch)
tree90000b0e8552f28acca388349e2f68ba5c5bc2ee
parentmod_mam: Simplify 'message_is_archived' callback (diff)
mod_stream_mgmt: Improve logging on timeout
Produce a better error message if a pending stream management session times out.
-rw-r--r--src/mod_stream_mgmt.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mod_stream_mgmt.erl b/src/mod_stream_mgmt.erl
index 2bf151a04..658bd504e 100644
--- a/src/mod_stream_mgmt.erl
+++ b/src/mod_stream_mgmt.erl
@@ -36,6 +36,7 @@
%% adjust pending session timeout
-export([get_resume_timeout/1, set_resume_timeout/2]).
+-include("ejabberd.hrl").
-include("xmpp.hrl").
-include("logger.hrl").
-include("p1_queue.hrl").
@@ -247,7 +248,10 @@ c2s_handle_info(#{mgmt_state := pending,
{timeout, TRef, pending_timeout}) ->
?DEBUG("Timed out waiting for resumption of stream for ~s",
[jid:encode(JID)]),
- Mod:stop(State#{mgmt_state => timeout});
+ Txt = <<"Timed out waiting for stream resumption">>,
+ Err = xmpp:serr_connection_timeout(Txt, ?MYLANG),
+ Mod:stop(State#{mgmt_state => timeout,
+ stop_reason => {stream, {out, Err}}});
c2s_handle_info(#{jid := JID} = State, {_Ref, {resume, OldState}}) ->
%% This happens if the resume_session/1 request timed out; the new session
%% now receives the late response.