1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-25 20:18:00 +01:00

[tcp] Set shutdownTimestamp before queue.shutdown()

In the writer thread, we use shutdownTimestamp to determine if we
should break out of the writer loop. If we set
shutdownTimestamp *after* queue.shutdown(), then there is a brief
period where nextStreamElement() returns 'null' but done() still
returns 'true'. Hence, we switch the logic "setting" those values.
This commit is contained in:
Florian Schmaus 2024-10-17 18:08:31 +02:00
parent 9e5ac5a39a
commit 6e6a3ef88d

View file

@ -1305,8 +1305,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
*/
void shutdown(boolean instant) {
instantShutdown = instant;
queue.shutdown();
shutdownTimestamp = System.currentTimeMillis();
queue.shutdown();
}
/**