From af7f046b85694db45d670054e28960e4a0d79232 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 14 Mar 2010 16:56:00 +0000 Subject: Don't send a 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. --- protocols/jabber/io.c | 8 +++++--- protocols/jabber/jabber.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'protocols') 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( "" - "", jd->server ); + greet = g_strdup_printf( "%s", + ( jd->flags & JFLAG_STARTTLS_DONE ) ? "" : "", + 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 -- cgit v1.2.3