1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-21 22:02:06 +01:00

[tcp] Cleanup handling of stream errors in XMPPTCPConnection

There is no need to notify waiting threads, throwing the stream error
will also notify them. Also settings tlsHandled to true is no longer
necessary.
This commit is contained in:
Florian Schmaus 2020-05-31 19:44:53 +02:00
parent b7465e8200
commit 7d129d6f6c

View file

@ -949,12 +949,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
break; break;
case "error": case "error":
StreamError streamError = PacketParserUtils.parseStreamError(parser); StreamError streamError = PacketParserUtils.parseStreamError(parser);
currentXmppException = new StreamErrorException(streamError); // Stream errors are non recoverable, throw this exceptions. Also note that this will set
// Mark the tlsHandled sync point as success, we will use the saslFeatureReceived sync // this exception as current connection exceptions and notify any waiting threads.
// point to report the error, which is checked immediately after tlsHandled in
// connectInternal().
tlsHandled = true;
notifyWaiters();
throw new StreamErrorException(streamError); throw new StreamErrorException(streamError);
case "features": case "features":
parseFeaturesAndNotify(parser); parseFeaturesAndNotify(parser);