mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +01:00
[tcp] Do not needlessly wait for closing stream tag
This commit is contained in:
parent
84b7adb764
commit
b7465e8200
1 changed files with 12 additions and 7 deletions
|
@ -477,6 +477,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void shutdown(boolean instant) {
|
private void shutdown(boolean instant) {
|
||||||
|
// The writer thread may already been finished at this point, for example when the connection is in the
|
||||||
|
// disconnected-but-resumable state. There is no need to wait for the closing stream tag from the server in this
|
||||||
|
// case.
|
||||||
|
if (!packetWriter.done()) {
|
||||||
// First shutdown the writer, this will result in a closing stream element getting send to
|
// First shutdown the writer, this will result in a closing stream element getting send to
|
||||||
// the server
|
// the server
|
||||||
LOGGER.finer("PacketWriter shutdown()");
|
LOGGER.finer("PacketWriter shutdown()");
|
||||||
|
@ -486,6 +490,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
if (!instant) {
|
if (!instant) {
|
||||||
waitForClosingStreamTagFromServer();
|
waitForClosingStreamTagFromServer();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LOGGER.finer("PacketReader shutdown()");
|
LOGGER.finer("PacketReader shutdown()");
|
||||||
packetReader.shutdown();
|
packetReader.shutdown();
|
||||||
|
|
Loading…
Reference in a new issue