- Timestamp:
- 2006-01-20T15:15:49Z (18 years ago)
- Branches:
- master
- Children:
- 54879ab, f1d38f2
- Parents:
- 55ec2d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r55ec2d6 rf73b969 152 152 } 153 153 154 /* immed=1 makes this function pretty much equal to irc_free(), except that 155 this one will "log". In case the connection is already broken and we 156 shouldn't try to write to it. */ 154 157 void irc_abort( irc_t *irc, int immed, char *format, ... ) 155 158 { 156 va_list params;157 158 159 if( format != NULL ) 159 160 { 161 va_list params; 160 162 char *reason; 161 163 162 164 va_start( params, format ); 163 reason = g_strdup_ printf( format, params );165 reason = g_strdup_vprintf( format, params ); 164 166 va_end( params ); 165 167 … … 168 170 169 171 ipc_to_master_str( "OPERMSG :Client exiting: %s@%s [%s]\r\n", 170 irc->nick , irc->host, reason");172 irc->nick ? irc->nick : "(NONE)", irc->host, reason ); 171 173 172 174 g_free( reason ); … … 178 180 179 181 ipc_to_master_str( "OPERMSG :Client exiting: %s@%s [%s]\r\n", 180 irc->nick , irc->host, "No reason given" );182 irc->nick ? irc->nick : "(NONE)", irc->host, "No reason given" ); 181 183 } 182 184 … … 339 341 } 340 342 341 intirc_process( irc_t *irc )343 void irc_process( irc_t *irc ) 342 344 { 343 345 char **lines, *temp, **cmd; … … 361 363 if( ( cmd = irc_parse_line( lines[i] ) ) == NULL ) 362 364 continue; 363 if( !irc_exec( irc, cmd ) ) 364 { 365 g_free( cmd ); 366 g_free( lines ); 367 return 0; 368 } 365 irc_exec( irc, cmd ); 369 366 370 367 g_free( cmd ); 368 369 /* Shouldn't really happen, but just in case... */ 370 if( !g_slist_find( irc_connection_list, irc ) ) 371 { 372 g_free( lines ); 373 return; 374 } 371 375 } 372 376 … … 379 383 g_free( lines ); 380 384 } 381 382 return 1;383 385 } 384 386 … … 972 974 973 975 if( u->send_handler ) 974 return( u->send_handler( irc, u, s, flags ) ); 976 { 977 u->send_handler( irc, u, s, flags ); 978 return 1; 979 } 975 980 } 976 981 else if( c && c->gc && c->gc->prpl ) … … 998 1003 } 999 1004 1000 intbuddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags )1001 { 1002 if( !u || !u->gc ) return ( 0 );1005 void buddy_send_handler( irc_t *irc, user_t *u, char *msg, int flags ) 1006 { 1007 if( !u || !u->gc ) return; 1003 1008 1004 1009 if( set_getint( irc, "buddy_sendbuffer" ) && set_getint( irc, "buddy_sendbuffer_delay" ) > 0 ) … … 1036 1041 g_source_remove( u->sendbuf_timer ); 1037 1042 u->sendbuf_timer = g_timeout_add( delay, buddy_send_handler_delayed, u ); 1038 1039 return( 1 );1040 1043 } 1041 1044 else 1042 1045 { 1043 return( serv_send_im( irc, u, msg, flags ));1046 serv_send_im( irc, u, msg, flags ); 1044 1047 } 1045 1048 } … … 1146 1149 if( rv > 0 ) 1147 1150 { 1148 irc_abort( irc, "ERROR :Closing Link:Ping Timeout: %d seconds", rv );1151 irc_abort( irc, 0, "Ping Timeout: %d seconds", rv ); 1149 1152 return FALSE; 1150 1153 }
Note: See TracChangeset
for help on using the changeset viewer.