Ticket #1: patch_1_fix_s2s.patch
| File patch_1_fix_s2s.patch, 4.6 KB (added by Simon, 8 months ago) |
|---|
-
c2s/c2s.c
597 597 char from[1024]; 598 598 sess_t sess; 599 599 union xhashv xhv; 600 char *key; 600 601 601 602 if((attr = nad_find_attr(nad, 0, -1, "from", NULL)) < 0) { 602 603 nad_free(nad); … … 611 612 612 613 log_debug(ZONE, "sm for serviced domain '%s' online", from); 613 614 614 xhash_put(c2s->sm_avail, pstrdup(xhash_pool(c2s->sm_avail), from), (void *) 1); 615 if (xhash_get(c2s->sm_avail, from) == NULL) { 616 key = pstrdup(xhash_pool(c2s->sm_avail), from); 617 xhash_put(c2s->sm_avail, key, key); 618 } 615 619 616 620 nad_free(nad); 617 621 return; … … 624 628 625 629 log_debug(ZONE, "component unavailable from '%s'", from); 626 630 627 if(xhash_get(c2s->sm_avail, from) != NULL) { 631 key = xhash_get(c2s->sm_avail, from); 632 if(key != NULL) { 628 633 log_debug(ZONE, "sm for serviced domain '%s' offline", from); 629 634 630 635 if(xhash_iter_first(c2s->sessions)) … … 639 644 sx_close(sess->s); 640 645 } 641 646 } while(xhash_iter_next(c2s->sessions)); 642 647 643 648 xhash_zap(c2s->sm_avail, from); 649 free(key); 644 650 } 645 651 } 646 652 -
configure.ac
383 383 AC_CHECK_LIB(gsasl, gsasl_check_version) 384 384 fi 385 385 if test "x-$ac_cv_lib_gsasl_gsasl_check_version" = "x-yes" ; then 386 AC_MSG_CHECKING(for GnuSASL version >= 0.2.2 6)386 AC_MSG_CHECKING(for GnuSASL version >= 0.2.21) 387 387 AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <gsasl.h>]], 388 [[return !(gsasl_check_version("0.2.2 6"))]])],388 [[return !(gsasl_check_version("0.2.21"))]])], 389 389 [AC_MSG_RESULT(yes) 390 390 sasl_backend='gsasl'], 391 391 AC_MSG_RESULT(no)) -
s2s/in.c
139 139 xhash_put(s2s->in_accept, pstrdup(xhash_pool(s2s->in_accept),ipport), (void *) in); 140 140 141 141 #ifdef HAVE_SSL 142 sx_server_init(in->s, S2S_DB_HEADER | ((s2s-> local_pemfile!= NULL) ? SX_SSL_STARTTLS_OFFER : 0) );142 sx_server_init(in->s, S2S_DB_HEADER | ((s2s->sx_ssl != NULL) ? SX_SSL_STARTTLS_OFFER : 0) ); 143 143 #else 144 144 sx_server_init(in->s, S2S_DB_HEADER); 145 145 #endif -
s2s/out.c
283 283 284 284 #ifdef HAVE_SSL 285 285 /* Send a stream version of 1.0 if we can do STARTTLS */ 286 if(out->s2s->sx_ssl != NULL && out->s2s->local_pemfile != NULL) {286 if(out->s2s->sx_ssl != NULL) { 287 287 sx_client_init(out->s, S2S_DB_HEADER, uri_SERVER, pkt->to->domain, pkt->from->domain, "1.0"); 288 288 } else { 289 289 sx_client_init(out->s, S2S_DB_HEADER, uri_SERVER, NULL, NULL, NULL); … … 617 617 618 618 /* if no stream version from either side, kick off dialback for each route, */ 619 619 /* otherwise wait for stream features */ 620 if ((out->s->res_version==NULL) || (out->s2s->sx_ssl == NULL) || (out->s2s->local_pemfile == NULL)) {620 if ((out->s->res_version==NULL) || (out->s2s->sx_ssl == NULL)) { 621 621 log_debug(ZONE, "no stream version, sending dialbacks for %s immediately", out->key); 622 622 out->online = 1; 623 623 send_dialbacks(out); … … 643 643 644 644 #ifdef HAVE_SSL 645 645 /* starttls if we can */ 646 if(out->s2s->sx_ssl != NULL && out->s2s->local_pemfile != NULL &&s->ssf == 0) {646 if(out->s2s->sx_ssl != NULL && s->ssf == 0) { 647 647 ns = nad_find_scoped_namespace(nad, uri_TLS, NULL); 648 648 if(ns >= 0) { 649 649 elem = nad_find_elem(nad, 0, ns, "starttls", 1); 650 650 if(elem >= 0) { 651 651 log_debug(ZONE, "got STARTTLS in stream features"); 652 if(sx_ssl_client_starttls(out->s2s->sx_ssl, s, out->s2s->local_pemfile) == 0) {652 if(sx_ssl_client_starttls(out->s2s->sx_ssl, s, NULL) == 0) { 653 653 starttls = 1; 654 654 nad_free(nad); 655 655 return 0;
