Skip to content

Commit

Permalink
tsilo: restore also the global t branch index
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Aug 30, 2022
1 parent 72234f9 commit 837d7ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/tsilo/ts_append.c
Expand Up @@ -100,14 +100,16 @@ int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str *
struct sip_msg *orig_msg;
int ret;
str stable;
int orig_branch;

if(contact->s!=NULL && contact->len > 0) {
LM_DBG("trying to append based on specific contact <%.*s>\n", contact->len, contact->s);
}

/* lookup a transaction based on its identifier (hash_index:label) */
orig_t = _tmb.t_gett();
orig_branch = _tmb.t_gett_branch();

/* lookup a transaction based on its identifier (hash_index:label) */
if(_tmb.t_lookup_ident(&t, tindex, tlabel) < 0)
{
LM_ERR("transaction [%u:%u] not found\n", tindex, tlabel);
Expand Down Expand Up @@ -155,7 +157,7 @@ int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str *
/* unref the transaction which had been referred by t_lookup_ident() call.
* Restore the original transaction (if any) */
if(t) _tmb.unref_cell(t);
_tmb.t_sett(orig_t, T_BR_UNDEFINED);
_tmb.t_sett(orig_t, orig_branch);

return ret;
}

0 comments on commit 837d7ea

Please sign in to comment.