mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 10:19:41 +02:00
Smack 4.1.4
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJV9nAlXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxMzU3QjAxODY1QjI1MDNDMTg0NTNEMjA4 Q0FDMkE5Njc4NTQ4RTM1AAoJEIysKpZ4VI41sFEIAJlfRspk6S5ymNc4w7u/FT1w MpHT/cxqIQIBU9J5dYqeW6Y8O6VuUeknCmZBEv7dIVHroTmvfosMauAyRZJXWeeL FQQTBqDJszYdM88x/d5X6d25lCEBdQkdDh2a5s9AIy9RH0iXE74AypuikbroK+VC zI3wRPUFq7WnARtmiP2NalSgSNv5ToeicBO+JSniQ+O52ZAlP2FSDfi4uzPPigdP Ip/V3eF4Bp0YZimcxAnWdnMU+ciVLClRYKgD3+qTEoic7dx3dzeTyrk1NoLRgQl9 mfcNXBgUScHZAoSIkR0QiUx9ktPCJ950qa+XtW3B8NtDOZkXegUL/a8ukQAuz+k= =qMsC -----END PGP SIGNATURE----- Merge tag '4.1.4' Smack 4.1.4
This commit is contained in:
commit
04a0004035
10 changed files with 96 additions and 12 deletions
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smack.tcp;
|
||||
|
||||
import org.jivesoftware.smack.AbstractConnectionListener;
|
||||
import org.jivesoftware.smack.AbstractXMPPConnection;
|
||||
import org.jivesoftware.smack.ConnectionConfiguration;
|
||||
import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode;
|
||||
|
@ -299,6 +300,14 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
public XMPPTCPConnection(XMPPTCPConnectionConfiguration config) {
|
||||
super(config);
|
||||
this.config = config;
|
||||
addConnectionListener(new AbstractConnectionListener() {
|
||||
@Override
|
||||
public void connectionClosedOnError(Exception e) {
|
||||
if (e instanceof XMPPException.StreamErrorException) {
|
||||
dropSmState();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -398,7 +407,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
// connection instance though). This is used in writePackets to decide if stanzas should
|
||||
// be added to the unacknowledged stanzas queue, because they have to be added right
|
||||
// after the 'enable' stream element has been sent.
|
||||
unacknowledgedStanzas = null;
|
||||
dropSmState();
|
||||
}
|
||||
if (isSmAvailable() && useSm) {
|
||||
// Remove what is maybe left from previously stream managed sessions
|
||||
|
@ -1715,6 +1724,17 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop the stream management state. Sets {@link #smSessionId} and
|
||||
* {@link #unacknowledgedStanzas} to <code>null</code>.
|
||||
*/
|
||||
private void dropSmState() {
|
||||
// clientHandledCount and serverHandledCount will be reset on <enable/> and <enabled/>
|
||||
// respective. No need to reset them here.
|
||||
smSessionId = null;
|
||||
unacknowledgedStanzas = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum resumption time in seconds after which a managed stream can be resumed.
|
||||
* <p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue