]> granicus.if.org Git - ejabberd/commitdiff
Don't use close/2: set stop_reason explicitly
authorEvgeny Khramtsov <ekhramtsov@process-one.net>
Thu, 8 Aug 2019 08:21:28 +0000 (11:21 +0300)
committerEvgeny Khramtsov <ekhramtsov@process-one.net>
Thu, 8 Aug 2019 08:21:28 +0000 (11:21 +0300)
Fixes #2984

src/mod_stream_mgmt.erl

index 042efc249ae04af797906cfe7e6334c808327b9c..d149438c1dbde0ebcc5a78a03b82780c3e27c276 100644 (file)
@@ -239,8 +239,9 @@ c2s_handle_info(#{mgmt_ack_timer := TRef, jid := JID, mod := Mod} = State,
                {timeout, TRef, ack_timeout}) ->
     ?DEBUG("Timed out waiting for stream management acknowledgement of ~s",
           [jid:encode(JID)]),
-    State1 = Mod:close(State, ack_timeout),
-    {stop, transition_to_pending(State1, ack_timeout)};
+    State1 = Mod:close(State),
+    State2 = State1#{stop_reason => {socket, ack_timeout}},
+    {stop, transition_to_pending(State2, ack_timeout)};
 c2s_handle_info(#{mgmt_state := pending, lang := Lang,
                  mgmt_pending_timer := TRef, jid := JID, mod := Mod} = State,
                {timeout, TRef, pending_timeout}) ->