Changeset 0356ae3


Ignore:
Timestamp:
2006-05-13T22:30:51Z (13 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
3f199fc
Parents:
19ac9c5
Message:

irc_vawrite() now first attempts to write() immediately (because that's
usually not a problem) and only touches the event queue when the write()
doesn't write everything. And got rid of a quit element in the irc_t
structure that actually wasn't even used.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r19ac9c5 r0356ae3  
    576576        char line[IRC_MAX_LINE+1], *cs;
    577577               
    578         if( irc->quit )
     578        /* Don't try to write anything new anymore when shutting down. */
     579        if( irc->status == USTATUS_SHUTDOWN )
    579580                return;
    580581       
     
    605606       
    606607        if( irc->w_watch_source_id == 0 )
    607                 irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc );
     608        {
     609                /* If the buffer is empty we can probably write, so call the write event handler
     610                   immediately. If it returns TRUE, it should be called again, so add the event to
     611                   the queue. If it's FALSE, we emptied the buffer and saved ourselves some work
     612                   in the event queue. */
     613                if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) )
     614                        irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc );
     615        }
    608616       
    609617        return;
  • irc.h

    r19ac9c5 r0356ae3  
    6161        char *sendbuffer;
    6262        char *readbuffer;
    63         int quit;
    6463
    6564        int sentbytes;
Note: See TracChangeset for help on using the changeset viewer.