[PATCH] Connection Delays

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();
         }

Hi,

here goes your code should work fine - no / needed to terminate the code section. Anyhow a scrollbar will be displayed and this is annoying but so the forum design is not broken.

LG

Ah ok, the tag changed when a new update was installed (I think it was using []-tag delimiters back then), and the graphical interface inserts -tags, which don’'t work at all.

Does this fixes the dreaded javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection problem and will it get merged officially by the devs?

Thanks

Srgjan

Message was edited by: schrepfler

Message was edited by: schrepfler

schrepfler wrote:

Does this fixes the dreaded javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection problem

Not intentionally. I haven’‘t seen it again since I’'m using that patch, though.

and will it get merged officially by the devs?

I sure hope so.

Thanks, I’'ve filed this as SMACK-161.

-Matt

Hey guys,

FYI, the bug fix has been included and will be available with the next nightly build.

Thanks,

– Gato