diff --git a/modules/tm/t_cancel.c b/modules/tm/t_cancel.c index bba7f7057c0..ff606f12ed8 100644 --- a/modules/tm/t_cancel.c +++ b/modules/tm/t_cancel.c @@ -110,6 +110,8 @@ void cancel_branch( struct cell *t, int branch ) crb->activ_type=TYPE_LOCAL_CANCEL; LM_DBG("sending cancel...\n"); + if (t->uac[branch].br_flags & tcp_no_new_conn_bflag) + tcp_no_new_conn = 1; if (SEND_BUFFER( crb )==0) { if ( has_tran_tmcbs( t, TMCB_REQUEST_BUILT|TMCB_MSG_SENT_OUT) ) { set_extra_tmcb_params( &crb->buffer, &crb->dst); @@ -117,6 +119,7 @@ void cancel_branch( struct cell *t, int branch ) t, t->uas.request, 0, 0); } } + tcp_no_new_conn = 0; /*sets and starts the FINAL RESPONSE timer */ start_retr( crb ); diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c index 05b5909f940..e1cbb377add 100644 --- a/modules/tm/t_reply.c +++ b/modules/tm/t_reply.c @@ -310,6 +310,9 @@ static int send_ack(struct sip_msg* rpl, struct cell *trans, int branch) goto error; } + if (trans->uac[branch].br_flags & tcp_no_new_conn_bflag) + tcp_no_new_conn = 1; + if(SEND_PR_BUFFER(&trans->uac[branch].request, ack_buf.s, ack_buf.len)==0){ /* successfully sent out */ if ( has_tran_tmcbs( trans, TMCB_MSG_SENT_OUT) ) { @@ -319,6 +322,8 @@ static int send_ack(struct sip_msg* rpl, struct cell *trans, int branch) } } + tcp_no_new_conn = 0; + shm_free(ack_buf.s); return 0; diff --git a/modules/tm/uac.c b/modules/tm/uac.c index 920304939ba..1e50d1b894e 100644 --- a/modules/tm/uac.c +++ b/modules/tm/uac.c @@ -471,12 +471,17 @@ int t_uac(str* method, str* headers, str* body, dlg_t* dialog, REF_UNSAFE(new_cell); } + if (new_cell->uac[0].br_flags & tcp_no_new_conn_bflag) + tcp_no_new_conn = 1; + if (SEND_BUFFER(request) == -1) { LM_ERR("attempt to send to '%.*s' failed\n", dialog->hooks.next_hop->len, dialog->hooks.next_hop->s); } + tcp_no_new_conn = 0; + if (method->len==ACK_LEN && memcmp(method->s, ACK, ACK_LEN)==0 ) { t_release_transaction(new_cell); } else {