Changes in protocols/jabber/io.c [315dd4c:8a2221a7]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
r315dd4c r8a2221a7 375 375 376 376 if( ( c = xt_find_node( node->children, "bind" ) ) ) 377 jd->flags |= JFLAG_WANT_BIND; 377 { 378 reply = xt_new_node( "bind", NULL, xt_new_node( "resource", set_getstr( &ic->acc->set, "resource" ), NULL ) ); 379 xt_add_attr( reply, "xmlns", XMLNS_BIND ); 380 reply = jabber_make_packet( "iq", "set", NULL, reply ); 381 jabber_cache_add( ic, reply, jabber_pkt_bind_sess ); 382 383 if( !jabber_write_packet( ic, reply ) ) 384 return XT_ABORT; 385 386 jd->flags |= JFLAG_WAIT_BIND; 387 } 378 388 379 389 if( ( c = xt_find_node( node->children, "session" ) ) ) 380 jd->flags |= JFLAG_WANT_SESSION; 381 382 if( jd->flags & JFLAG_AUTHENTICATED ) 383 return jabber_pkt_bind_sess( ic, NULL, NULL ); 390 { 391 reply = xt_new_node( "session", NULL, NULL ); 392 xt_add_attr( reply, "xmlns", XMLNS_SESSION ); 393 reply = jabber_make_packet( "iq", "set", NULL, reply ); 394 jabber_cache_add( ic, reply, jabber_pkt_bind_sess ); 395 396 if( !jabber_write_packet( ic, reply ) ) 397 return XT_ABORT; 398 399 jd->flags |= JFLAG_WAIT_SESSION; 400 } 401 402 /* This flag is already set if we authenticated via SASL, so now 403 we can resume the session in the new stream, if we don't have 404 to bind/initialize the session. */ 405 if( jd->flags & JFLAG_AUTHENTICATED && ( jd->flags & ( JFLAG_WAIT_BIND | JFLAG_WAIT_SESSION ) ) == 0 ) 406 { 407 if( !jabber_get_roster( ic ) ) 408 return XT_ABORT; 409 } 384 410 385 411 return XT_HANDLED; … … 415 441 imcb_log( ic, "Converting stream to TLS" ); 416 442 417 jd->flags |= JFLAG_STARTTLS_DONE;418 443 jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); 419 444 … … 506 531 jd->r_inpa = b_input_add( jd->fd, GAIM_INPUT_READ, jabber_read_callback, ic ); 507 532 508 greet = g_strdup_printf( "%s<stream:stream to=\"%s\" xmlns=\"jabber:client\" " 509 "xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">", 510 ( jd->flags & JFLAG_STARTTLS_DONE ) ? "" : "<?xml version='1.0' ?>", 511 jd->server ); 533 greet = g_strdup_printf( "<?xml version='1.0' ?>" 534 "<stream:stream to=\"%s\" xmlns=\"jabber:client\" " 535 "xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">", jd->server ); 512 536 513 537 st = jabber_write( ic, greet, strlen( greet ) );
Note: See TracChangeset
for help on using the changeset viewer.