| 148 | static unsigned int ctx_stack_idx = 0; |
| 149 | |
| 150 | int push_new_global_context(void) |
| 151 | { |
| 152 | if (ctx_stack_idx==CTX_STACK_SIZE) { |
| 153 | LM_ERR("too many stacked contexts (%d)\n",ctx_stack_idx); |
| 154 | return 0; |
| 155 | } |
| 156 | |
| 157 | ctx_stack[ctx_stack_idx++] = current_processing_ctx; |
| 158 | |
| 159 | current_processing_ctx = context_alloc(CONTEXT_GLOBAL); |
| 160 | if (!current_processing_ctx) { |
| 161 | LM_ERR("oom\n"); |
| 162 | current_processing_ctx = ctx_stack[--ctx_stack_idx]; |
| 163 | return 0; |
| 164 | } |
| 165 | |
| 166 | memset(current_processing_ctx, 0, context_size(CONTEXT_GLOBAL)); |
| 167 | return 1; |
| 168 | } |
| 169 | |
| 170 | int pop_pushed_global_context(void) |
| 171 | { |
no test coverage detected