Skip to content

Commit

Permalink
context: return 0 if pushing context fails 1 otherwise
Browse files Browse the repository at this point in the history
(cherry picked from commit 7c93e59)
  • Loading branch information
razvancrainea committed Jul 31, 2023
1 parent 16b4067 commit 050db88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions context.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ int push_new_global_context(void)
{
if (ctx_stack_idx==CTX_STACK_SIZE) {
LM_ERR("too many stacked contexts (%d)\n",ctx_stack_idx);
return -1;
return 0;
}

ctx_stack[ctx_stack_idx++] = current_processing_ctx;
Expand All @@ -160,11 +160,11 @@ int push_new_global_context(void)
if (!current_processing_ctx) {
LM_ERR("oom\n");
current_processing_ctx = ctx_stack[--ctx_stack_idx];
return -1;
return 0;
}

memset(current_processing_ctx, 0, context_size(CONTEXT_GLOBAL));
return 0;
return 1;
}

int pop_pushed_global_context(void)
Expand Down

0 comments on commit 050db88

Please sign in to comment.