Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2016-06-21 23:54:41 +0300
committerHolger Weiss <holger@zedat.fu-berlin.de>2016-06-21 23:54:41 +0300
commit7ddeac38b6bd0a16f46331cca9ba029492d8648a (patch)
tree4f069bea28cad1d5bbfce6e5a6505c9684cd8ee6
parent3a8da27d86058dae9e60467a08b146f9fc676736 (diff)
XEP-0198: Also count stanzas when socket is closed
Don't forget to count stanzas received from the stream management client that are processed right after the connection was lost.
-rw-r--r--src/ejabberd_c2s.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
index 2a1018827..12838f2fe 100644
--- a/src/ejabberd_c2s.erl
+++ b/src/ejabberd_c2s.erl
@@ -2802,7 +2802,9 @@ check_h_attribute(#state{mgmt_stanzas_out = NumStanzasOut} = StateData, H) ->
[jid:to_string(StateData#state.jid), H, NumStanzasOut]),
mgmt_queue_drop(StateData, H).
-update_num_stanzas_in(#state{mgmt_state = active} = StateData, El) ->
+update_num_stanzas_in(StateData, El)
+ when StateData#state.mgmt_state == active;
+ StateData#state.mgmt_state == pending ->
NewNum = case {is_stanza(El), StateData#state.mgmt_stanzas_in} of
{true, 4294967295} ->
0;