]> granicus.if.org Git - ejabberd/commitdiff
XEP-0198: Also count stanzas when socket is closed
authorHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 21 Jun 2016 20:54:41 +0000 (22:54 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 21 Jun 2016 20:54:41 +0000 (22:54 +0200)
Don't forget to count stanzas received from the stream management client
that are processed right after the connection was lost.

src/ejabberd_c2s.erl

index 2a1018827d7f850832abb626e3435cb45f8102fa..12838f2fef5ad1e549dd1a4918b7a3e4a41c6a12 100644 (file)
@@ -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;