Skip to content

Commit dd79818

Browse files
committed
run reply async resume route under lock, if needed
1 parent 16ef67d commit dd79818

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

modules/tm/async.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,6 @@ int t_resume_async_reply(int fd, void*param, int was_timeout)
223223
{
224224
async_tm_ctx *ctx = (async_tm_ctx *)param;
225225
struct cell *backup_t;
226-
struct cell *backup_cancelled_t;
227-
struct cell *backup_e2eack_t;
228226
struct usr_avp **backup_list;
229227
struct cell *t= ctx->t;
230228
int route;
@@ -316,14 +314,22 @@ int t_resume_async_reply(int fd, void*param, int was_timeout)
316314
if (async_status == ASYNC_DONE_CLOSE_FD && valid_async_fd(fd))
317315
close(fd);
318316

317+
318+
/* we run the resume route under lock, if needed */
319+
if (onreply_avp_mode)
320+
LOCK_REPLIES(t);
321+
319322
/* run the resume_route (some type as the original one) */
320323
swap_route_type(route, ctx->route_type);
321324
/* do not run any post script callback, we are a reply */
322325
run_resume_route( ctx->resume_route, ctx->reply, 0);
323326
set_route_type(route);
324327

325328
/* DO TM suspended actions to decide if we need to relay */
326-
LOCK_REPLIES( t );
329+
if (!onreply_avp_mode)
330+
/* if we haven't locked above to run route under lock,
331+
* lock things now as we process the reply */
332+
LOCK_REPLIES(t);
327333

328334
process_reply_and_timer(t,branch,msg_status,ctx->reply,last_uac_status,reply_uac);
329335

0 commit comments

Comments
 (0)