Changes in protocols/jabber/io.c [8fb1263:e046390]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/io.c
r8fb1263 re046390 64 64 most cases it probably won't be necessary.) */ 65 65 if( ( ret = jabber_write_queue( ic ) ) && jd->tx_len > 0 ) 66 jd->w_inpa = b_input_add( jd->fd, GAIM_INPUT_WRITE, jabber_write_callback, ic );66 jd->w_inpa = b_input_add( jd->fd, B_EV_IO_WRITE, jabber_write_callback, ic ); 67 67 } 68 68 else … … 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; 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 } 381 401 382 402 /* This flag is already set if we authenticated via SASL, so now 383 403 we can resume the session in the new stream, if we don't have 384 404 to bind/initialize the session. */ 385 if( jd->flags & JFLAG_AUTHENTICATED && ( jd->flags & ( JFLAG_WA NT_BIND | JFLAG_WANT_SESSION ) ) == 0 )405 if( jd->flags & JFLAG_AUTHENTICATED && ( jd->flags & ( JFLAG_WAIT_BIND | JFLAG_WAIT_SESSION ) ) == 0 ) 386 406 { 387 407 if( !jabber_get_roster( ic ) ) 388 408 return XT_ABORT; 389 }390 else if( jd->flags & JFLAG_AUTHENTICATED )391 {392 return jabber_pkt_bind_sess( ic, NULL, NULL );393 409 } 394 410 … … 425 441 imcb_log( ic, "Converting stream to TLS" ); 426 442 427 jd->flags |= JFLAG_STARTTLS_DONE;428 443 jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic ); 429 444 … … 514 529 515 530 if( jd->r_inpa <= 0 ) 516 jd->r_inpa = b_input_add( jd->fd, GAIM_INPUT_READ, jabber_read_callback, ic ); 517 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 ); 531 jd->r_inpa = b_input_add( jd->fd, B_EV_IO_READ, jabber_read_callback, ic ); 532 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 ); 522 536 523 537 st = jabber_write( ic, greet, strlen( greet ) );
Note: See TracChangeset
for help on using the changeset viewer.