diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-18 23:17:59 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-18 23:17:59 +0100 |
commit | 4c266f2d79212e4e0ff4b9b33088685a2ec452e4 (patch) | |
tree | 57312efb83e7f4eb1351215dec285d56dc7ebf99 /bitlbee.c | |
parent | 1ea13be2cf335a471f85ea54d610fb91b7d14564 (diff) | |
parent | c1826c6f72d1fe85e1c5decf5207601dac2c23e7 (diff) |
Merged (and adapted) changes from main tree.
Diffstat (limited to 'bitlbee.c')
-rw-r--r-- | bitlbee.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -169,7 +169,7 @@ gboolean bitlbee_io_current_client_read( GIOChannel *source, GIOCondition condit if( !irc_process( irc ) ) { log_message( LOGLVL_INFO, "Destroying connection with fd %d.", irc->fd ); - irc_free( irc ); + irc_abort( irc ); return FALSE; } @@ -177,7 +177,7 @@ gboolean bitlbee_io_current_client_read( GIOChannel *source, GIOCondition condit if( irc->readbuffer && ( strlen( irc->readbuffer ) > 1024 ) ) { log_message( LOGLVL_ERROR, "Maximum line length exceeded." ); - irc_free( irc ); + irc_abort( irc ); return FALSE; } @@ -196,25 +196,25 @@ gboolean bitlbee_io_current_client_write( GIOChannel *source, GIOCondition condi size = strlen( irc->sendbuffer ); st = write( irc->fd, irc->sendbuffer, size ); - if( st <= 0 ) + if( st == 0 || ( st < 0 && !sockerr_again() ) ) { - if( sockerr_again() ) - { - return TRUE; - } - else - { - irc_free( irc ); - return FALSE; - } + irc_free( irc ); + return FALSE; + } + else if( st < 0 ) /* && sockerr_again() */ + { + return TRUE; } if( st == size ) { g_free( irc->sendbuffer ); irc->sendbuffer = NULL; - irc->w_watch_source_id = 0; + + if( irc->status == USTATUS_SHUTDOWN ) + irc_free( irc ); + return( FALSE ); } else |