diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-20 13:21:24 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-01-20 13:21:24 +0100 |
commit | fc50d482ae5a7836fbf7c72df168b51d1cf714a5 (patch) | |
tree | 985aa41b83b307649b6d7f135a0dafbf1ba7aa6a /bitlbee.c | |
parent | 2fa825ba7c79a0ab4ed9a534865974e918b49100 (diff) |
irc_abort() does logging (including a reason) now.
Diffstat (limited to 'bitlbee.c')
-rw-r--r-- | bitlbee.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -162,14 +162,14 @@ gboolean bitlbee_io_current_client_read( GIOChannel *source, GIOCondition condit if( condition & G_IO_ERR || condition & G_IO_HUP ) { - irc_free( irc ); + irc_abort( irc, 1, "Read error" ); return FALSE; } st = read( irc->fd, line, sizeof( line ) - 1 ); if( st == 0 ) { - irc_free( irc ); + irc_abort( irc, 1, "Connection reset by peer" ); return FALSE; } else if( st < 0 ) @@ -180,7 +180,7 @@ gboolean bitlbee_io_current_client_read( GIOChannel *source, GIOCondition condit } else { - irc_free( irc ); + irc_abort( irc, 1, "Read error: %s", strerror( errno ) ); return FALSE; } } @@ -206,8 +206,7 @@ gboolean bitlbee_io_current_client_read( GIOChannel *source, GIOCondition condit /* Very naughty, go read the RFCs! >:) */ if( irc->readbuffer && ( strlen( irc->readbuffer ) > 1024 ) ) { - log_message( LOGLVL_ERROR, "Maximum line length exceeded." ); - irc_abort( irc ); + irc_abort( irc, 0, "Maximum line length exceeded" ); return FALSE; } @@ -228,7 +227,7 @@ gboolean bitlbee_io_current_client_write( GIOChannel *source, GIOCondition condi if( st == 0 || ( st < 0 && !sockerr_again() ) ) { - irc_free( irc ); + irc_abort( irc, 1, "Write error: %s", strerror( errno ) ); return FALSE; } else if( st < 0 ) /* && sockerr_again() */ |