diff --git a/source/org/jivesoftware/smack/PacketReader.java b/source/org/jivesoftware/smack/PacketReader.java index a7a1e1462..0cc02900b 100644 --- a/source/org/jivesoftware/smack/PacketReader.java +++ b/source/org/jivesoftware/smack/PacketReader.java @@ -477,7 +477,8 @@ class PacketReader { } } } - if (!startTLSReceived) { + // Release the lock after TLS has been negotiated or we are not insterested in TLS + if (!startTLSReceived || !connection.getConfiguration().isTLSEnabled()) { releaseConnectionIDLock(); } } diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index 2a28afd25..c0c4f8cd6 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -1069,6 +1069,15 @@ public class XMPPConnection { return saslAuthentication; } + /** + * Returns the configuration used while connecting to the server. + * + * @return the configuration used while connecting to the server. + */ + ConnectionConfiguration getConfiguration() { + return configuration; + } + /** * Notification message saying that the server supports TLS so confirm the server that we * want to secure the connection.