diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-14 16:56:00 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-03-14 16:56:00 +0000 |
commit | af7f046b85694db45d670054e28960e4a0d79232 (patch) | |
tree | 71a8fe95b97e4e5eba3bf9f3d534b32945a3aa7c | |
parent | 435f55271b09102e21228a7add1b897025cdb078 (diff) |
Don't send a <?xml> stream start after starttls since it upsets certain
jabberd's including Zimbra's. Thanks to jMCg and balzar in #bitlbee for
helping with figuring this out.
-rw-r--r-- | protocols/jabber/io.c | 8 | ||||
-rw-r--r-- | protocols/jabber/jabber.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index 10efad37..9534ff1a 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -440,6 +440,7 @@ static xt_status jabber_pkt_proceed_tls( struct xt_node *node, gpointer data ) imcb_log( ic, "Converting stream to TLS" ); + jd->flags |= JFLAG_STARTTLS_DONE; jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); return XT_HANDLED; @@ -530,9 +531,10 @@ gboolean jabber_start_stream( struct im_connection *ic ) if( jd->r_inpa <= 0 ) jd->r_inpa = b_input_add( jd->fd, GAIM_INPUT_READ, jabber_read_callback, ic ); - greet = g_strdup_printf( "<?xml version='1.0' ?>" - "<stream:stream to=\"%s\" xmlns=\"jabber:client\" " - "xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">", jd->server ); + greet = g_strdup_printf( "%s<stream:stream to=\"%s\" xmlns=\"jabber:client\" " + "xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">", + ( jd->flags & JFLAG_STARTTLS_DONE ) ? "" : "<?xml version='1.0' ?>", + jd->server ); st = jabber_write( ic, greet, strlen( greet ) ); diff --git a/protocols/jabber/jabber.h b/protocols/jabber/jabber.h index 7bb66e0e..a6cceb5a 100644 --- a/protocols/jabber/jabber.h +++ b/protocols/jabber/jabber.h @@ -45,6 +45,7 @@ typedef enum JFLAG_WANT_TYPING = 32, /* Set if we ever sent a typing notification, this activates all XEP-85 related code. */ JFLAG_XMLCONSOLE = 64, /* If the user added an xmlconsole buddy. */ + JFLAG_STARTTLS_DONE = 128, /* If a plaintext session was converted to TLS. */ } jabber_flags_t; typedef enum |