Changeset 3330468 for protocols/jabber/io.c
- Timestamp:
- 2010-03-14T23:15:05Z (14 years ago)
- Branches:
- master
- Children:
- 81ee561
- Parents:
- 7c5affca (diff), 7e2b593 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
r7c5affca r3330468 375 375 376 376 if( ( c = xt_find_node( node->children, "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 } 377 jd->flags |= JFLAG_WANT_BIND; 388 378 389 379 if( ( c = xt_find_node( node->children, "session" ) ) ) 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 } 380 jd->flags |= JFLAG_WANT_SESSION; 401 381 402 382 /* This flag is already set if we authenticated via SASL, so now 403 383 we can resume the session in the new stream, if we don't have 404 384 to bind/initialize the session. */ 405 if( jd->flags & JFLAG_AUTHENTICATED && ( jd->flags & ( JFLAG_WA IT_BIND | JFLAG_WAIT_SESSION ) ) == 0 )385 if( jd->flags & JFLAG_AUTHENTICATED && ( jd->flags & ( JFLAG_WANT_BIND | JFLAG_WANT_SESSION ) ) == 0 ) 406 386 { 407 387 if( !jabber_get_roster( ic ) ) 408 388 return XT_ABORT; 389 } 390 else if( jd->flags & JFLAG_AUTHENTICATED ) 391 { 392 return jabber_pkt_bind_sess( ic, NULL, NULL ); 409 393 } 410 394 … … 441 425 imcb_log( ic, "Converting stream to TLS" ); 442 426 427 jd->flags |= JFLAG_STARTTLS_DONE; 443 428 jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); 444 429 … … 531 516 jd->r_inpa = b_input_add( jd->fd, B_EV_IO_READ, jabber_read_callback, ic ); 532 517 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 ); 518 greet = g_strdup_printf( "%s<stream:stream to=\"%s\" xmlns=\"jabber:client\" " 519 "xmlns:stream=\"http://etherx.jabber.org/streams\" version=\"1.0\">", 520 ( jd->flags & JFLAG_STARTTLS_DONE ) ? "" : "<?xml version='1.0' ?>", 521 jd->server ); 536 522 537 523 st = jabber_write( ic, greet, strlen( greet ) );
Note: See TracChangeset
for help on using the changeset viewer.