From 7d129d6f6ce40c6f9a7b6e2c066428e929066836 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 31 May 2020 19:44:53 +0200 Subject: [PATCH] [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. --- .../org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index 361eb2255..3e30f83b5 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -949,12 +949,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { break; case "error": StreamError streamError = PacketParserUtils.parseStreamError(parser); - currentXmppException = new StreamErrorException(streamError); - // Mark the tlsHandled sync point as success, we will use the saslFeatureReceived sync - // point to report the error, which is checked immediately after tlsHandled in - // connectInternal(). - tlsHandled = true; - notifyWaiters(); + // Stream errors are non recoverable, throw this exceptions. Also note that this will set + // this exception as current connection exceptions and notify any waiting threads. throw new StreamErrorException(streamError); case "features": parseFeaturesAndNotify(parser);