Skip to content

Commit

Permalink
Fix changing proto via force_send_socket().
Browse files Browse the repository at this point in the history
If the RURI does not request any protocol, use the proto of the forced socket (if any).
Related to #420

(cherry picked from commit ac8c2e6)
  • Loading branch information
bogdan-iancu committed Apr 2, 2015
1 parent a9ea0a1 commit 2284294
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion modules/tm/t_funcs.c
Expand Up @@ -208,7 +208,9 @@ int t_relay_to( struct sip_msg *p_msg , struct proxy_l *proxy, int flags)
LM_DBG("forwarding ACK\n");
/* send it out */
if (proxy==0) {
proxy=uri2proxy(GET_NEXT_HOP(p_msg), PROTO_NONE);
proxy=uri2proxy(GET_NEXT_HOP(p_msg),
p_msg->force_send_socket ?
p_msg->force_send_socket->proto : PROTO_NONE );
if (proxy==0) {
ret=E_BAD_ADDRESS;
goto done;
Expand Down
4 changes: 3 additions & 1 deletion modules/tm/t_fwd.c
Expand Up @@ -374,7 +374,9 @@ static int add_uac( struct cell *t, struct sip_msg *request, str *uri,
do_free_proxy = 0;
}else {
proxy=uri2proxy( request->dst_uri.len ?
&request->dst_uri:&request->new_uri, PROTO_NONE );
&request->dst_uri:&request->new_uri,
request->force_send_socket ?
request->force_send_socket->proto : PROTO_NONE );
if (proxy==0) {
ret=E_BAD_ADDRESS;
goto error01;
Expand Down
3 changes: 2 additions & 1 deletion modules/tm/uac.c
Expand Up @@ -198,7 +198,8 @@ int t_uac(str* method, str* headers, str* body, dlg_t* dialog,
dialog->hooks.next_hop->s);

/* calculate the socket corresponding to next hop */
proxy = uri2proxy( dialog->hooks.next_hop, PROTO_NONE );
proxy = uri2proxy( dialog->hooks.next_hop,
dialog->send_sock ? dialog->send_sock->proto : PROTO_NONE );
if (proxy==0) {
ret=E_BAD_ADDRESS;
goto error3;
Expand Down

0 comments on commit 2284294

Please sign in to comment.