Changeset 59f527b6
- Timestamp:
- 2008-01-12T17:24:38Z (17 years ago)
- Branches:
- master
- Children:
- fc0cf92
- Parents:
- e64de00
- Location:
- protocols/msn
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.h
re64de00 r59f527b6 29 29 #define GROUPCHAT_SWITCHBOARD_MESSAGE "\r\r\rME WANT TALK TO MANY PEOPLE\r\r\r" 30 30 31 #ifdef _WIN3232 #define debug 31 #ifdef DEBUG 32 #define debug( text... ) imcb_log( ic, text ); 33 33 #else 34 #define debug( text... ) irc_usermsg( IRC, text );35 #undef debug36 34 #define debug( text... ) 37 35 #endif … … 66 64 GSList *msgq; 67 65 GSList *switchboards; 66 int sb_failures; 67 time_t first_sb_failure; 68 68 69 const struct msn_away_state *away_state; 69 70 70 int buddycount; 71 71 int groupcount; -
protocols/msn/sb.c
re64de00 r59f527b6 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
Note: See TracChangeset
for help on using the changeset viewer.