Hi,
I got pretty sick of that connection delay Smack introduces on connecting. I’'ve fixed it, my patch is attached.
(I’‘m sorry for the formatting, the forum’'s preformat-tag seems to be broken)
--- ../smack-dev-2.2.1/source/org/jivesoftware/smack/XMPPConnection.java 2006-06-12 23:13:15.000000000 +0200
+++ source/org/jivesoftware/smack/XMPPConnection.java 2006-07-28 00:43:35.000000000 +0200
@@ -141,10 +141,14 @@
/**
* Holds the initial configuration used while creating the connection.
*/
private ConnectionConfiguration configuration; + ConnectionConfiguration getConfiguration() {
+ return configuration;
+ }
+
/**
* Creates a new connection to the specified XMPP server. A DNS SRV lookup will be
* performed to try to determine the IP address and port corresponding to the
* serviceName; if that lookup fails, it''s assumed that server resides at serviceName
* with the default port of 5222. This is the preferred constructor for connecting
--- ../smack-dev-2.2.1/source/org/jivesoftware/smack/PacketReader.java 2006-06-12 23:13:15.000000000 +0200
+++ source/org/jivesoftware/smack/PacketReader.java 2006-07-28 00:43:54.000000000 +0200
@@ -501,5 +504,5 @@
}
}
- if (!startTLSReceived) {
+ if (!(startTLSReceived && connection.getConfiguration().isTLSEnabled())) {
releaseConnectionIDLock();
}