diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2012-09-17 00:47:18 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2012-09-17 00:47:18 +0100 | 
| commit | daf544ac6a08ce2fc0f9bd2b07c70ea349a41e30 (patch) | |
| tree | 67973977d3ed85e426bcc378f0da169ecd755147 /protocols/jabber/io.c | |
| parent | ddca104c8c6e75e0b70bf804a23c98a78946fbdb (diff) | |
Handle see-other-host requests from XMPP servers. This should fix MSN/WLM
XMPP support.
Diffstat (limited to 'protocols/jabber/io.c')
| -rw-r--r-- | protocols/jabber/io.c | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/protocols/jabber/io.c b/protocols/jabber/io.c index 5b9149af..3f84d95c 100644 --- a/protocols/jabber/io.c +++ b/protocols/jabber/io.c @@ -452,8 +452,39 @@ static xt_status jabber_pkt_proceed_tls( struct xt_node *node, gpointer data )  static xt_status jabber_pkt_stream_error( struct xt_node *node, gpointer data )  {  	struct im_connection *ic = data; +	struct jabber_data *jd = ic->proto_data;  	int allow_reconnect = TRUE;  	struct jabber_error *err; +	struct xt_node *host; +	 +	if( !( ic->flags & OPT_LOGGED_IN ) && +	    ( host = xt_find_node( node->children, "see-other-host" ) ) && +	    host->text ) +	{ +		char *s; +		int port = set_getint( &ic->acc->set, "port" ); +		 +		/* Let's try to obey this request, if we're not logged +		   in yet (i.e. not have too much state yet). */ +		if( jd->ssl ) +			ssl_disconnect( jd->ssl ); +		closesocket( jd->fd ); +		b_event_remove( jd->r_inpa ); +		b_event_remove( jd->w_inpa ); +		 +		jd->ssl = NULL; +		jd->r_inpa = jd->w_inpa = 0; +		jd->flags &= JFLAG_XMLCONSOLE; +		 +		s = strchr( host->text, ':' ); +		if( s != NULL ) +			sscanf( s + 1, "%d", &port ); +		 +		imcb_log( ic, "Redirected to %s", host->text ); +		jd->fd = proxy_connect( host->text, port, jabber_connected_plain, ic ); +		 +		return XT_ABORT; +	}  	err = jabber_error_parse( node, XMLNS_STREAM_ERROR ); | 
