1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-23 20:04:51 +02:00
Smack/smack-tcp/src/main/java/org/jivesoftware/smack/tcp
Florian Schmaus c9eb6323c0 Fix a race on graceful disconnect
A sequence of connect(), disconnect(), and connect() could cause the
connection to get disconnected again by the old reader thread, which was
blocking on disconnect because a closing stream tag was read. If the
second connect() was processed before the disconnect(), then the
connectin would get disconnected right after the second connect().

This showed up as a "strange" sequence of stanzas in the XMPP servers
log. Note that the stanza ID of the unavailable presence has a lower
number then the previous stanzas:

Jun 11 23:11:11 c2s18c2370      debug   Resource bound: smack-inttest-two-93t70@geekplace.eu/two-93t70
Jun 11 23:11:11 c2s18c2370      debug   Received[c2s]: <iq id='qn03S-26' type='get'>
Jun 11 23:11:11 c2s18c2370      debug   Received[c2s]: <presence id='qn03S-27'>
Jun 11 23:11:11 c2s18c2370      debug   Received[c2s]: <presence id='qn03S-23' type='unavailable'>
Jun 11 23:11:11 c2s18c2370      debug   Received </stream:stream>

This is because the disconnect() of the first reader thread could
generate the unavailable presence, but was blocked afterwards when
entering the synchronized disconnect(Presence unavailablePresence).

SMACK-633.
2015-06-13 19:26:57 +02:00
..
BundleAndDefer.java Minor javadoc fixes and improvements 2015-02-22 10:41:53 +01:00
BundleAndDeferCallback.java Improve the bundle and defer mechanism 2015-02-22 10:51:44 +01:00
package-info.java Add JavadocPackage checkstyle 2015-04-04 17:16:47 +02:00
TCPInitializer.java Enable OSGi compliance via 'DynamicImport-Package: *' 2015-01-03 13:14:02 +01:00
XMPPTCPConnection.java Fix a race on graceful disconnect 2015-06-13 19:26:57 +02:00
XMPPTCPConnectionConfiguration.java Deprecate setServiceName in favor of setXmppDomain 2015-06-08 14:42:05 +02:00