- Timestamp:
- 2006-10-11T18:29:56Z (18 years ago)
- Branches:
- master
- Children:
- 259edd4
- Parents:
- 58b5f62
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
r58b5f62 rb56b220 162 162 { 163 163 /* Parse. */ 164 if( !xt_feed( jd->xt, buf, st ))164 if( xt_feed( jd->xt, buf, st ) < 0 ) 165 165 { 166 166 hide_login_progress_error( gc, "XML stream error" ); … … 279 279 static xt_status jabber_end_of_stream( struct xt_node *node, gpointer data ) 280 280 { 281 signoff( data ); 281 282 return XT_ABORT; 282 283 } … … 427 428 } 428 429 430 static xt_status jabber_pkt_stream_error( struct xt_node *node, gpointer data ) 431 { 432 struct gaim_connection *gc = data; 433 struct xt_node *c; 434 char *s, *type = NULL, *text = NULL; 435 436 for( c = node->children; c; c = c->next ) 437 { 438 if( !( s = xt_find_attr( c, "xmlns" ) ) || 439 strcmp( s, "urn:ietf:params:xml:ns:xmpp-streams" ) != 0 ) 440 continue; 441 442 if( strcmp( c->name, "text" ) != 0 ) 443 { 444 type = c->name; 445 } 446 /* Only use the text if it doesn't have an xml:lang attribute, 447 if it's empty or if it's set to something English. */ 448 else if( !( s = xt_find_attr( c, "xml:lang" ) ) || 449 !*s || strncmp( s, "en", 2 ) == 0 ) 450 { 451 text = c->text; 452 } 453 } 454 455 /* Tssk... */ 456 if( type == NULL ) 457 { 458 hide_login_progress_error( gc, "Unknown stream error reported by server" ); 459 signoff( gc ); 460 return XT_ABORT; 461 } 462 463 /* We know that this is a fatal error. If it's a "conflict" error, we 464 should turn off auto-reconnect to make sure we won't get some nasty 465 infinite loop! */ 466 if( strcmp( type, "conflict" ) == 0 ) 467 gc->wants_to_die = TRUE; 468 469 s = g_strdup_printf( "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" ); 470 hide_login_progress_error( gc, s ); 471 g_free( s ); 472 signoff( gc ); 473 474 return XT_ABORT; 475 } 476 429 477 static xt_status jabber_pkt_misc( struct xt_node *node, gpointer data ) 430 478 { … … 441 489 { "iq", "stream:stream", jabber_pkt_iq }, 442 490 { "stream:features", "stream:stream", jabber_pkt_features }, 491 { "stream:error", "stream:stream", jabber_pkt_stream_error }, 443 492 { "proceed", "stream:stream", jabber_pkt_proceed_tls }, 444 493 { "challenge", "stream:stream", sasl_pkt_challenge },
Note: See TracChangeset
for help on using the changeset viewer.