mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-24 15:22:07 +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,14 +477,19 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void shutdown(boolean instant) {
|
private void shutdown(boolean instant) {
|
||||||
// First shutdown the writer, this will result in a closing stream element getting send to
|
// The writer thread may already been finished at this point, for example when the connection is in the
|
||||||
// the server
|
// disconnected-but-resumable state. There is no need to wait for the closing stream tag from the server in this
|
||||||
LOGGER.finer("PacketWriter shutdown()");
|
// case.
|
||||||
packetWriter.shutdown(instant);
|
if (!packetWriter.done()) {
|
||||||
LOGGER.finer("PacketWriter has been shut down");
|
// First shutdown the writer, this will result in a closing stream element getting send to
|
||||||
|
// the server
|
||||||
|
LOGGER.finer("PacketWriter shutdown()");
|
||||||
|
packetWriter.shutdown(instant);
|
||||||
|
LOGGER.finer("PacketWriter has been shut down");
|
||||||
|
|
||||||
if (!instant) {
|
if (!instant) {
|
||||||
waitForClosingStreamTagFromServer();
|
waitForClosingStreamTagFromServer();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER.finer("PacketReader shutdown()");
|
LOGGER.finer("PacketReader shutdown()");
|
||||||
|
|
Loading…
Reference in a new issue