Skip to content

Commit f4ecb3d

Browse files
committed
Migrate modules from append_branch() to append_msg_branch()
Completes 31092f1
1 parent 4497e44 commit f4ecb3d

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

modules/cpl_c/cpl_sig.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ int cpl_proxy_to_loc_set( struct sip_msg *msg, struct location **locs,
3838
unsigned char flag)
3939
{
4040
struct location *foo;
41+
struct msg_branch branch;
4142
int bflags;
4243
int r;
4344

@@ -75,8 +76,12 @@ int cpl_proxy_to_loc_set( struct sip_msg *msg, struct location **locs,
7576
bflags = ((*locs)->flags&CPL_LOC_NATED) ? cpl_fct.ulb.nat_flag : 0 ;
7677
LM_DBG("appending branch <%.*s>, flags %d\n",
7778
(*locs)->addr.uri.len, (*locs)->addr.uri.s, bflags);
78-
if(append_branch(msg, &(*locs)->addr.uri, &(*locs)->addr.received,0,
79-
Q_UNSPECIFIED, bflags, 0)==-1){
79+
memset( &branch, 0, sizeof branch);
80+
branch.uri = (*locs)->addr.uri;
81+
branch.dst_uri = (*locs)->addr.received;
82+
branch.q = Q_UNSPECIFIED;
83+
branch.bflags = bflags;
84+
if (append_msg_branch(&branch)==-1){
8085
LM_ERR("failed when appending branch <%s>\n",(*locs)->addr.uri.s);
8186
goto error;
8287
}

modules/osp/orig_transaction.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ static int ospPrepareDestination(
967967
osp_inbound* inbound = ospGetInboundInfo();
968968
osp_dest* dest = ospGetNextOrigDestination();
969969
int result = MODULE_RETURNCODE_TRUE;
970+
struct msg_branch branch;
970971

971972
if (inbound != NULL) {
972973
if (dest != NULL) {
@@ -1004,7 +1005,10 @@ static int ospPrepareDestination(
10041005
set_ruri(msg, &newuri);
10051006
set_ruri_q(msg, qvalue);
10061007
} else {
1007-
append_branch(msg, &newuri, NULL, NULL, qvalue, 0, NULL);
1008+
memset( &branch, 0, sizeof branch);
1009+
branch.uri = newuri;
1010+
branch.q = qvalue;
1011+
append_msg_branch( &branch );
10081012
}
10091013

10101014
/* Do not add route specific OSP information */
@@ -1032,7 +1036,10 @@ static int ospPrepareDestination(
10321036
if (isfirst == OSP_FIRST_ROUTE) {
10331037
set_ruri(msg, &newuri);
10341038
} else {
1035-
append_branch(msg, &newuri, NULL, NULL, Q_UNSPECIFIED, 0, NULL);
1039+
memset( &branch, 0, sizeof branch);
1040+
branch.uri = newuri;
1041+
branch.q = Q_UNSPECIFIED;
1042+
append_msg_branch( &branch );
10361043
}
10371044

10381045
/* Do not add route specific OSP information */

modules/perl/opensipsxs.xs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,7 @@ append_branch(self, branch = NULL, qval = NULL)
11361136
int err = 0;
11371137
struct action *act = NULL;
11381138
str branch_s;
1139+
struct msg_branch mbranch;
11391140
INIT:
11401141
CODE:
11411142
if (!msg) {
@@ -1162,10 +1163,16 @@ append_branch(self, branch = NULL, qval = NULL)
11621163
}
11631164
}
11641165

1165-
if (RETVAL != -1)
1166-
RETVAL = append_branch(msg, branch_s.s ? &branch_s : NULL,
1167-
&msg->dst_uri, &msg->path_vec, q, getb0flags(msg),
1168-
msg->force_send_socket);
1166+
if (RETVAL != -1) {
1167+
memset( &mbranch, 0, sizeof mbranch);
1168+
mbranch.uri = branch_s.s ? branch_s : *GET_RURI(msg);
1169+
mbranch.dst_uri = msg->dst_uri;
1170+
mbranch.path = msg->path_vec;
1171+
mbranch.q = q;
1172+
mbranch.bflags = getb0flags(msg);
1173+
mbranch.force_send_socket = msg->force_send_socket;
1174+
RETVAL = append_msg_branch( &mbranch );
1175+
}
11691176
}
11701177
OUTPUT:
11711178
RETVAL

0 commit comments

Comments
 (0)