1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +01:00

Synchronize later in notifyConnectionError(Exception)

especially *after* the sync points have been notified so that a
potential thread currently callin gconnect()/login() throws and leaves
the synchronized section.

This commit is more or less equivalent to
3ded023629 of the 4.3 branch.
This commit is contained in:
Florian Schmaus 2019-03-16 10:30:16 +01:00
parent daab6039a1
commit 8e52e80399

View file

@ -858,9 +858,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
ASYNC_BUT_ORDERED.performAsyncButOrdered(this, () -> {
currentConnectionException = exception;
synchronized (AbstractXMPPConnection.this) {
notifyAll();
}
for (StanzaCollector collector : collectors) {
collector.notifyConnectionError(exception);
@ -873,10 +870,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
// XMPPTCPConnection. Create delegation method?
// maybeCompressFeaturesReceived.reportGenericFailure(smackWrappedException);
// Closes the connection temporary. A if the connection supports stream management, then a reconnection is
// possible. Note that a connection listener of e.g. XMPPTCPConnection will drop the SM state in
// case the Exception is a StreamErrorException.
instantShutdown();
synchronized (AbstractXMPPConnection.this) {
notifyAll();
// Closes the connection temporary. A if the connection supports stream management, then a reconnection is
// possible. Note that a connection listener of e.g. XMPPTCPConnection will drop the SM state in
// case the Exception is a StreamErrorException.
instantShutdown();
}
Async.go(() -> {
// Notify connection listeners of the error.