Skip to content

Commit

Permalink
tm: simplify the fix in commit 82b8d20
Browse files Browse the repository at this point in the history
Just unref the transactions and avoid the extra checks
done by do_t_cleanup().
  • Loading branch information
rvlad-patrascu committed Nov 24, 2020
1 parent 357a3ae commit e8a7cad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions modules/tm/cluster.c
Expand Up @@ -36,8 +36,6 @@ static str tm_repl_cap = str_init("tm-repl");

struct clusterer_binds cluster_api;

int do_t_cleanup( struct sip_msg *req, void *bar);

#define TM_BIN_POP(_t, _f, _d) \
do { \
if (bin_pop_##_t(packet, _f) < 0) { \
Expand Down Expand Up @@ -155,7 +153,11 @@ static void tm_repl_cancel(bin_packet_t *packet, str *buf, struct receive_info *
LM_ERR("cannot handle auto-CANCEL for %p!\n", t);

cleanup:
do_t_cleanup(&msg, NULL);
t_unref_cell(t);

if ((t=get_t()) != NULL && t != T_UNDEFINED)
t_unref_cell(t);

free_sip_msg(&msg);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/tm/tm.c
Expand Up @@ -667,7 +667,7 @@ int load_tm( struct tm_binds *tmb)
}


int do_t_cleanup( struct sip_msg *req, void *bar)
static int do_t_cleanup( struct sip_msg *req, void *bar)
{
struct cell *t;

Expand Down

0 comments on commit e8a7cad

Please sign in to comment.