Changeset b5c8a34 for protocols/jabber


Ignore:
Timestamp:
2008-01-24T22:49:47Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
764c7d1, f774e01
Parents:
613cc55
Message:

Keeping track of valid Jabber connections so _connected() events will be
ignored if the connection's dead already. Necessary if using GLib for event
handling for now. :-/

Location:
protocols/jabber
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/io.c

    r613cc55 rb5c8a34  
    249249        struct im_connection *ic = data;
    250250       
     251        if( g_slist_find( jabber_connections, ic ) == NULL )
     252                return FALSE;
     253       
    251254        if( source == -1 )
    252255        {
     
    264267{
    265268        struct im_connection *ic = data;
    266         struct jabber_data *jd = ic->proto_data;
     269        struct jabber_data *jd;
     270       
     271        if( g_slist_find( jabber_connections, ic ) == NULL )
     272                return FALSE;
     273       
     274        jd = ic->proto_data;
    267275       
    268276        if( source == NULL )
  • protocols/jabber/jabber.c

    r613cc55 rb5c8a34  
    3535#include "base64.h"
    3636
     37GSList *jabber_connections;
     38
    3739static void jabber_init( account_t *acc )
    3840{
     
    7072        struct ns_srv_reply *srv = NULL;
    7173        char *connect_to, *s;
     74       
     75        /* For now this is needed in the _connected() handlers if using
     76           GLib event handling, to make sure we're not handling events
     77           on dead connections. */
     78        jabber_connections = g_slist_prepend( jabber_connections, ic );
    7279       
    7380        jd->ic = ic;
     
    263270        g_free( jd->username );
    264271        g_free( jd );
     272       
     273        jabber_connections = g_slist_remove( jabber_connections, ic );
    265274}
    266275
  • protocols/jabber/jabber.h

    r613cc55 rb5c8a34  
    2929#include "xmltree.h"
    3030#include "bitlbee.h"
     31
     32extern GSList *jabber_connections;
    3133
    3234typedef enum
Note: See TracChangeset for help on using the changeset viewer.