mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-21 19:42:05 +01:00
Delay notifyConnectionError in writer shutdown
This commit is contained in:
parent
8deac592fb
commit
08c93da56a
1 changed files with 6 additions and 1 deletions
|
@ -1349,6 +1349,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
}
|
||||
|
||||
private void writePackets() {
|
||||
Exception writerException = null;
|
||||
try {
|
||||
openStream();
|
||||
initalOpenStreamSend.reportSuccess();
|
||||
|
@ -1471,7 +1472,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
// The exception can be ignored if the the connection is 'done'
|
||||
// or if the it was caused because the socket got closed
|
||||
if (!(done() || queue.isShutdown())) {
|
||||
notifyConnectionError(e);
|
||||
writerException = e;
|
||||
} else {
|
||||
LOGGER.log(Level.FINE, "Ignoring Exception in writePackets()", e);
|
||||
}
|
||||
|
@ -1479,6 +1480,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
LOGGER.fine("Reporting shutdownDone success in writer thread");
|
||||
shutdownDone.reportSuccess();
|
||||
}
|
||||
// Delay notifyConnectionError after shutdownDone has been reported in the finally block.
|
||||
if (writerException != null) {
|
||||
notifyConnectionError(writerException);
|
||||
}
|
||||
}
|
||||
|
||||
private void drainWriterQueueToUnacknowledgedStanzas() {
|
||||
|
|
Loading…
Reference in a new issue