diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-02-10 11:36:48 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2018-02-10 11:36:48 +0300 |
commit | 97f913b8d93870448d03586df20b108147c1b8a7 (patch) | |
tree | cdb540ef109119910468a4a8828a5a78231371d0 | |
parent | 6c1a1bd0008a2f0217a7818b1c31d900a48acff1 (diff) | |
parent | 9fb2253aa94cc20581e0afd1a0648cca368b9338 (diff) |
Merge branch 'master' of github.com:processone/ejabberd
-rw-r--r-- | src/mod_stream_mgmt.erl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mod_stream_mgmt.erl b/src/mod_stream_mgmt.erl index baf72b329..48e7ac985 100644 --- a/src/mod_stream_mgmt.erl +++ b/src/mod_stream_mgmt.erl @@ -438,11 +438,15 @@ transition_to_pending(State) -> State. -spec check_h_attribute(state(), non_neg_integer()) -> state(). -check_h_attribute(#{mgmt_stanzas_out := NumStanzasOut, jid := JID} = State, H) +check_h_attribute(#{mgmt_stanzas_out := NumStanzasOut, jid := JID, + lang := Lang} = State, H) when H > NumStanzasOut -> - ?DEBUG("~s acknowledged ~B stanzas, but only ~B were sent", - [jid:encode(JID), H, NumStanzasOut]), - mgmt_queue_drop(State#{mgmt_stanzas_out => H}, NumStanzasOut); + ?WARNING_MSG("~s acknowledged ~B stanzas, but only ~B were sent", + [jid:encode(JID), H, NumStanzasOut]), + State1 = State#{mgmt_resend => false}, + Err = xmpp:serr_undefined_condition( + <<"Client acknowledged more stanzas than sent by server">>, Lang), + send(State1, Err); check_h_attribute(#{mgmt_stanzas_out := NumStanzasOut, jid := JID} = State, H) -> ?DEBUG("~s acknowledged ~B of ~B stanzas", [jid:encode(JID), H, NumStanzasOut]), |