Skip to content

Commit

Permalink
tm: use define for unset flags of run_trans_callbacks_with_buf()
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Nov 9, 2017
1 parent 4b19cda commit 33302f8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/modules/tm/t_append_branches.c
Expand Up @@ -189,7 +189,7 @@ int t_append_branches(void) {
if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_OUT)))
run_trans_callbacks_with_buf( TMCB_REQUEST_OUT,
&t->uac[nr_branches].request,
faked_req, 0, -orig_msg->REQ_METHOD);
faked_req, 0, TMCB_NONE_F);
}
else /* new branch added */
added_branches |= 1<<branch_ret;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/tm/t_fwd.c
Expand Up @@ -1585,7 +1585,7 @@ int t_send_branch( struct cell *t, int branch, struct sip_msg* p_msg ,
} else {
if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_SENT)))
run_trans_callbacks_with_buf(TMCB_REQUEST_SENT, &uac->request,
p_msg, 0,0);
p_msg, 0, TMCB_NONE_F);
/* start retr. only if the send succeeded */
if (start_retr( &uac->request )!=0){
LM_CRIT("BUG: retransmission already started for: %p\n",
Expand Down Expand Up @@ -1754,7 +1754,7 @@ int t_forward_nonack( struct cell *t, struct sip_msg* p_msg,
if (unlikely(has_tran_tmcbs(t, TMCB_REQUEST_OUT)))
run_trans_callbacks_with_buf( TMCB_REQUEST_OUT,
&t->uac[i].request,
p_msg, 0, -p_msg->REQ_METHOD);
p_msg, 0, TMCB_NONE_F);
}
else /* new branch added */
added_branches |= 1<<branch_ret;
Expand Down
1 change: 1 addition & 0 deletions src/modules/tm/t_hooks.h
Expand Up @@ -328,6 +328,7 @@ struct cell;
).
*/

#define TMCB_NONE_F 0
#define TMCB_RETR_F 1
#define TMCB_LOCAL_F 2

Expand Down
8 changes: 4 additions & 4 deletions src/modules/tm/t_reply.c
Expand Up @@ -515,7 +515,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
} else {
if(unlikely(has_tran_tmcbs(trans, TMCB_RESPONSE_READY))) {
run_trans_callbacks_with_buf(TMCB_RESPONSE_READY, rb,
trans->uas.request, FAKED_REPLY, code);
trans->uas.request, FAKED_REPLY, TMCB_NONE_F);
}
}
cleanup_uac_timers( trans );
Expand All @@ -532,7 +532,7 @@ static int _reply_light( struct cell *trans, char* buf, unsigned int len,
if (code==100) {
if(unlikely(has_tran_tmcbs(trans, TMCB_REQUEST_PENDING)))
run_trans_callbacks_with_buf(TMCB_REQUEST_PENDING, rb,
trans->uas.request, FAKED_REPLY, code);
trans->uas.request, FAKED_REPLY, TMCB_NONE_F);
}

/* send it out */
Expand Down Expand Up @@ -1946,7 +1946,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
if (relay >= 0) {
if (unlikely(!totag_retr && has_tran_tmcbs(t, TMCB_RESPONSE_READY))){
run_trans_callbacks_with_buf(TMCB_RESPONSE_READY, uas_rb,
t->uas.request, relayed_msg, relayed_code);
t->uas.request, relayed_msg, TMCB_NONE_F);
}
/* Set retransmission timer before the reply is sent out to avoid
* race conditions
Expand Down Expand Up @@ -1979,7 +1979,7 @@ enum rps relay_reply( struct cell *t, struct sip_msg *p_msg, int branch,
&& has_tran_tmcbs(t, TMCB_RESPONSE_OUT))){
LOCK_REPLIES( t );
run_trans_callbacks_with_buf( TMCB_RESPONSE_OUT, uas_rb,
t->uas.request, relayed_msg, relayed_code);
t->uas.request, relayed_msg, TMCB_NONE_F);
UNLOCK_REPLIES( t );
}
if (unlikely(has_tran_tmcbs(t, TMCB_RESPONSE_SENT))){
Expand Down

0 comments on commit 33302f8

Please sign in to comment.