Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/io.c

    r96f954d r0e788f5  
    44*  Jabber module - I/O stuff (plain, SSL), queues, etc                      *
    55*                                                                           *
    6 *  Copyright 2006 Wilmer van der Gaast <wilmer@gaast.net>                   *
     6*  Copyright 2006-2012 Wilmer van der Gaast <wilmer@gaast.net>              *
    77*                                                                           *
    88*  This program is free software; you can redistribute it and/or modify     *
     
    453453{
    454454        struct im_connection *ic = data;
     455        struct jabber_data *jd = ic->proto_data;
    455456        int allow_reconnect = TRUE;
    456457        struct jabber_error *err;
     458        struct xt_node *host;
     459       
     460        if( !( ic->flags & OPT_LOGGED_IN ) &&
     461            ( host = xt_find_node( node->children, "see-other-host" ) ) &&
     462            host->text )
     463        {
     464                char *s;
     465                int port = set_getint( &ic->acc->set, "port" );
     466               
     467                /* Let's try to obey this request, if we're not logged
     468                   in yet (i.e. not have too much state yet). */
     469                if( jd->ssl )
     470                        ssl_disconnect( jd->ssl );
     471                closesocket( jd->fd );
     472                b_event_remove( jd->r_inpa );
     473                b_event_remove( jd->w_inpa );
     474               
     475                jd->ssl = NULL;
     476                jd->r_inpa = jd->w_inpa = 0;
     477                jd->flags &= JFLAG_XMLCONSOLE;
     478               
     479                s = strchr( host->text, ':' );
     480                if( s != NULL )
     481                        sscanf( s + 1, "%d", &port );
     482               
     483                imcb_log( ic, "Redirected to %s", host->text );
     484                jd->fd = proxy_connect( host->text, port, jabber_connected_plain, ic );
     485               
     486                return XT_ABORT;
     487        }
    457488       
    458489        err = jabber_error_parse( node, XMLNS_STREAM_ERROR );
Note: See TracChangeset for help on using the changeset viewer.