Changeset c1826c6
- Timestamp:
- 2006-01-18T18:25:31Z (19 years ago)
- Branches:
- master
- Children:
- 4c266f2, 92ad3d4
- Parents:
- ac9f0e9
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.c
rac9f0e9 rc1826c6 200 200 { 201 201 log_message( LOGLVL_INFO, "Destroying connection with fd %d.", irc->fd ); 202 irc_ free( irc );202 irc_abort( irc ); 203 203 return FALSE; 204 204 } … … 208 208 { 209 209 log_message( LOGLVL_ERROR, "Maximum line length exceeded." ); 210 irc_ free( irc );210 irc_abort( irc ); 211 211 return FALSE; 212 212 } … … 227 227 st = write( irc->fd, irc->sendbuffer, size ); 228 228 229 if( st <= 0 ) 230 { 231 if( sockerr_again() ) 232 { 233 return TRUE; 234 } 235 else 236 { 237 irc_free( irc ); 238 return FALSE; 239 } 229 if( st == 0 || ( st < 0 && !sockerr_again() ) ) 230 { 231 irc_free( irc ); 232 return FALSE; 233 } 234 else if( st < 0 ) /* && sockerr_again() */ 235 { 236 return TRUE; 240 237 } 241 238 … … 244 241 g_free( irc->sendbuffer ); 245 242 irc->sendbuffer = NULL; 246 247 243 irc->w_watch_source_id = 0; 244 245 if( irc->status == USTATUS_SHUTDOWN ) 246 irc_free( irc ); 247 248 248 return( FALSE ); 249 249 } -
irc.c
rac9f0e9 rc1826c6 151 151 } 152 152 153 void irc_abort( irc_t *irc ) 154 { 155 irc->status = USTATUS_SHUTDOWN; 156 if( irc->sendbuffer ) 157 { 158 g_source_remove( irc->r_watch_source_id ); 159 irc->r_watch_source_id = g_timeout_add_full( G_PRIORITY_HIGH, 1000, (GSourceFunc) irc_free, irc, NULL ); 160 } 161 else 162 { 163 irc_free( irc ); 164 } 165 } 166 153 167 static gboolean irc_free_userhash( gpointer key, gpointer value, gpointer data ) 154 168 { … … 159 173 160 174 /* Because we have no garbage collection, this is quite annoying */ 161 void irc_free( irc_t * irc)175 void irc_free( irc_t * irc ) 162 176 { 163 177 account_t *account, *accounttmp; … … 496 510 { 497 511 irc_write( irc, "ERROR :%s%s", cmd[1]?"Quit: ":"", cmd[1]?cmd[1]:"Client Quit" ); 498 g_io_channel_close( irc->io_channel );512 /* g_io_channel_close( irc->io_channel ); */ 499 513 return( 0 ); 500 514 } -
irc.h
rac9f0e9 rc1826c6 44 44 USTATUS_AUTHORIZED, 45 45 USTATUS_LOGGED_IN, 46 USTATUS_IDENTIFIED 46 USTATUS_IDENTIFIED, 47 USTATUS_SHUTDOWN 47 48 } irc_status_t; 48 49 … … 104 105 105 106 irc_t *irc_new( int fd ); 107 void irc_abort( irc_t *irc ); 106 108 void irc_free( irc_t *irc ); 107 109
Note: See TracChangeset
for help on using the changeset viewer.