mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-12 21:52:07 +02:00
Don't count resent stanzas
Thanks to Holger Weiß for an advise
This commit is contained in:
parent
61cdee97fc
commit
bbfd089b7e
|
@ -24,7 +24,7 @@
|
||||||
{fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.10"}}},
|
{fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.10"}}},
|
||||||
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.7"}}},
|
{stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.7"}}},
|
||||||
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.20"}}},
|
{fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.20"}}},
|
||||||
{xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.1.6"}}},
|
{xmpp, ".*", {git, "https://github.com/processone/xmpp", "5c796d1c12eb34552c3e71dcff4cbb035735ff8d"}},
|
||||||
{stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.9"}}},
|
{stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.9"}}},
|
||||||
{esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.10"}}},
|
{esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.10"}}},
|
||||||
{fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.8"}}},
|
{fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.8"}}},
|
||||||
|
|
|
@ -182,6 +182,9 @@ c2s_handle_send(#{mgmt_state := MgmtState, mod := Mod,
|
||||||
when MgmtState == pending; MgmtState == active ->
|
when MgmtState == pending; MgmtState == active ->
|
||||||
case xmpp:is_stanza(Pkt) of
|
case xmpp:is_stanza(Pkt) of
|
||||||
true ->
|
true ->
|
||||||
|
Meta = xmpp:get_meta(Pkt),
|
||||||
|
case maps:get(mgmt_is_resent, Meta, false) of
|
||||||
|
false ->
|
||||||
case mgmt_queue_add(State, Pkt) of
|
case mgmt_queue_add(State, Pkt) of
|
||||||
#{mgmt_max_queue := exceeded} = State1 ->
|
#{mgmt_max_queue := exceeded} = State1 ->
|
||||||
State2 = State1#{mgmt_resend => false},
|
State2 = State1#{mgmt_resend => false},
|
||||||
|
@ -198,6 +201,9 @@ c2s_handle_send(#{mgmt_state := MgmtState, mod := Mod,
|
||||||
State1 ->
|
State1 ->
|
||||||
State1
|
State1
|
||||||
end;
|
end;
|
||||||
|
true ->
|
||||||
|
State
|
||||||
|
end;
|
||||||
false ->
|
false ->
|
||||||
State
|
State
|
||||||
end;
|
end;
|
||||||
|
@ -482,7 +488,7 @@ resend_unacked_stanzas(#{mgmt_state := MgmtState,
|
||||||
queue_foldl(
|
queue_foldl(
|
||||||
fun({_, Time, Pkt}, AccState) ->
|
fun({_, Time, Pkt}, AccState) ->
|
||||||
NewPkt = add_resent_delay_info(AccState, Pkt, Time),
|
NewPkt = add_resent_delay_info(AccState, Pkt, Time),
|
||||||
send(AccState, NewPkt)
|
send(AccState, xmpp:put_meta(NewPkt, mgmt_is_resent, true))
|
||||||
end, State, Queue);
|
end, State, Queue);
|
||||||
resend_unacked_stanzas(State) ->
|
resend_unacked_stanzas(State) ->
|
||||||
State.
|
State.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user