Changeset 883a398


Ignore:
Timestamp:
2008-04-02T21:36:02Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
8dbe021f
Parents:
fa75134
Message:

Rearranged some event handling code.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.c

    rfa75134 r883a398  
    226226        if( st == size )
    227227        {
    228                 g_free( irc->sendbuffer );
    229                 irc->sendbuffer = NULL;
    230                 irc->w_watch_source_id = 0;
    231                
    232228                if( irc->status & USTATUS_SHUTDOWN )
     229                {
    233230                        irc_free( irc );
     231                }
     232                else
     233                {
     234                        g_free( irc->sendbuffer );
     235                        irc->sendbuffer = NULL;
     236                        irc->w_watch_source_id = 0;
     237                }
    234238               
    235239                return FALSE;
  • irc.c

    rfa75134 r883a398  
    199199        if( irc->sendbuffer && !immed )
    200200        {
    201                 /* We won't read from this socket anymore. Instead, we'll connect a timer
    202                    to it that should shut down the connection in a second, just in case
    203                    bitlbee_.._write doesn't do it first. */
     201                /* Set up a timeout event that should shut down the connection
     202                   in a second, just in case ..._write doesn't do it first. */
    204203               
    205204                b_event_remove( irc->r_watch_source_id );
    206                 irc->r_watch_source_id = b_timeout_add( 1000, (b_event_handler) irc_free, irc );
     205                irc->r_watch_source_id = 0;
     206               
     207                b_event_remove( irc->ping_source_id );
     208                irc->ping_source_id = b_timeout_add( 1000, (b_event_handler) irc_free, irc );
    207209        }
    208210        else
     
    274276        if( irc->ping_source_id > 0 )
    275277                b_event_remove( irc->ping_source_id );
    276         b_event_remove( irc->r_watch_source_id );
     278        if( irc->r_watch_source_id > 0 )
     279                b_event_remove( irc->r_watch_source_id );
    277280        if( irc->w_watch_source_id > 0 )
    278281                b_event_remove( irc->w_watch_source_id );
Note: See TracChangeset for help on using the changeset viewer.