Changes in protocols/msn/sb.c [46dca11:8ff0a61]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/sb.c
r46dca11 r8ff0a61 277 277 { 278 278 struct msn_switchboard *sb = data; 279 struct im_connection *ic = sb->ic; 280 struct msn_data *md = ic->proto_data; 279 281 280 282 if( msn_handler( sb->handler ) == -1 ) 281 283 { 284 time_t now = time( NULL ); 285 286 if( now - md->first_sb_failure > 600 ) 287 { 288 /* It's not really the first one, but the start of this "series". 289 With this, the warning below will be shown only if this happens 290 at least three times in ten minutes. This algorithm isn't 291 perfect, but for this purpose it will do. */ 292 md->first_sb_failure = now; 293 md->sb_failures = 0; 294 } 295 282 296 debug( "Error: Switchboard died" ); 297 if( ++ md->sb_failures >= 3 ) 298 imcb_log( ic, "Warning: Many switchboard failures on MSN connection. " 299 "There might be problems delivering your messages." ); 300 301 if( sb->msgq != NULL ) 302 { 303 char buf[1024]; 304 305 if( md->msgq == NULL ) 306 { 307 md->msgq = sb->msgq; 308 } 309 else 310 { 311 GSList *l; 312 313 for( l = md->msgq; l->next; l = l->next ); 314 l->next = sb->msgq; 315 } 316 sb->msgq = NULL; 317 318 debug( "Moved queued messages back to the main queue, creating a new switchboard to retry." ); 319 g_snprintf( buf, sizeof( buf ), "XFR %d SB\r\n", ++md->trId ); 320 if( !msn_write( ic, buf, strlen( buf ) ) ) 321 return FALSE; 322 } 323 283 324 msn_sb_destroy( sb ); 284 325 … … 286 327 } 287 328 else 329 { 288 330 return TRUE; 331 } 289 332 } 290 333 … … 551 594 else 552 595 { 553 debug( "Received unknown command from switchboard server: %s", cmd[0] );596 /* debug( "Received unknown command from switchboard server: %s", cmd[0] ); */ 554 597 } 555 598
Note: See TracChangeset
for help on using the changeset viewer.