Holger Weiss [Fri, 30 May 2014 21:32:18 +0000 (23:32 +0200)]
Don't send XEP-0280 v1 copies back to sender
An earlier version of XEP-0280 specified the <received/> and <sent/>
tags to be siblings of the <forwarded/> element, whereas the current
version mandates them to be parents of <forwarded/>. The mod_carboncopy
module supports both variants. However, the check that makes sure
clients won't receive a copy of the messages they sent didn't work for
the old-style schema. This is now fixed.
Holger Weiss [Thu, 29 May 2014 13:21:11 +0000 (15:21 +0200)]
Log just one [info] message on Carbons negotiation
Log one instead of three [info] messages when XEP-0280 (Message Carbons)
support is enabled or disabled successfully. On failure, log an
additional [warning].
Holger Weiss [Wed, 28 May 2014 09:24:38 +0000 (11:24 +0200)]
XEP-0198: Cosmetic change: Reuse event handler
On stanza queue overflow, pass a message to self() using the exclamation
mark operator instead of send_all_state_event/2. This allows for
reusing the existing handler for 'kick' events.
Holger Weiss [Tue, 27 May 2014 20:56:33 +0000 (22:56 +0200)]
XEP-0198: Terminate session on queue overflow
On queue overflow, terminate the c2s session instead of just dropping
items from the queue. This makes sure all stanzas are either delivered
or bounced.
Holger Weiss [Tue, 27 May 2014 19:14:49 +0000 (21:14 +0200)]
XEP-0198: Cosmetic change: Simplify state change
When the FSM goes into the 'wait_for_resume' state, let fsm_next_state/2
take care of updating #state.mgmt_state and of writing the log line.
This doesn't change the behavior, but simplifies the code.
Holger Weiss [Fri, 23 May 2014 21:38:04 +0000 (23:38 +0200)]
XEP-0198: Don't drop session on failed resume
The 'previd' value provided by the client during a session resume
request includes the client's JID and ejabberd's session ID. If there
is a session for the requested JID but with a different session ID,
resumption should fail, but that session shouldn't be closed. This
commit makes sure the latter won't happen.
In practice, this will only make a difference in odd corner cases.
Holger Weiss [Fri, 23 May 2014 09:38:54 +0000 (11:38 +0200)]
XEP-0198: Don't exit on socket send failure
If stream management is enabled, don't exit the c2s process when
ejabberd_socket:send/2 fails, but close the socket instead. This gives
the client a chance to resume the session.
Thanks go to Matthias Rieber for reporting the issue, providing detailed
logs, and testing the fix.
Holger Weiss [Tue, 20 May 2014 22:07:57 +0000 (00:07 +0200)]
Omit XML namespace declaration for <iq/> stanzas
Only the child elements of <iq/> stanzas are qualified by the namespaces
in question, not the <iq/> stanzas themselves.
This change just clarifies the code. It doesn't alter the behaviour, as
those <iq/> stanzas are handed over to jlib:iq_to_xml/1, and that
function ignores the 'xmlns' attribute anyway.
Holger Weiss [Tue, 20 May 2014 21:00:28 +0000 (23:00 +0200)]
Don't use cached passwords if "extauth_cache: 0"
Regarding "extauth_cache", the guide says: "The integer 0 (zero) enables
caching for statistics, but doesn't use that cached information to
authenticate users." Make sure the cached password isn't used even if
the user is currently logged in with another resource.
Holger Weiss [Mon, 12 May 2014 17:20:25 +0000 (19:20 +0200)]
XEP-0198: Check whether routed packets are stanzas
Only stanzas are subject to stream management, so when XEP-0198 support
is enabled, we must distinguish them from non-stanza elements. This
commit adds a send_packet/2 function that can be used in place of
send_stanza/2 or send_element/2 whenever a packet is delivered that
might or might not be a stanza.
Holger Weiss [Fri, 9 May 2014 16:28:14 +0000 (18:28 +0200)]
XEP-0198: Improve handling of too large 'h' values
If the client says that it handled more stanzas than we sent (due to a
bug in the client's or in our code), increase our outgoing stanza count
accordingly. There's no point in sticking to the old value even if it
was correct, as the client surely won't fix its count during the current
session.
Holger Weiss [Fri, 9 May 2014 15:54:12 +0000 (17:54 +0200)]
XEP-0198: Don't warn on invalid ACK elements
Do not log a warning (but only a debug message) if the client sends an
invalid </a> packet. Some clients do that occasionally, and there's
nothing server admininistrators could do about that.