From 47cc26e2344385db18d027829c1d77e7792e7944 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Wed, 2 Aug 2006 22:17:11 +0000 Subject: [PATCH] Fixed possible delay when TLS is not supported by the server. SMACK-161 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@4773 b35dd754-fafc-0310-a699-88a17e54d16e --- source/org/jivesoftware/smack/PacketReader.java | 3 ++- source/org/jivesoftware/smack/XMPPConnection.java | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) 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.