* - -1 on failure.
*/
int unlang_interpret_push_function(request_t *request, unlang_function_t func, unlang_function_t repeat,
- unlang_function_signal_t signal, void *uctx)
+ unlang_function_signal_t signal, bool top_frame, void *uctx)
{
unlang_stack_t *stack = request->stack;
unlang_stack_frame_t *frame;
* Push module's function
*/
if (unlang_interpret_push(request, &function_instruction,
- RLM_MODULE_UNKNOWN, UNLANG_NEXT_STOP, UNLANG_SUB_FRAME) < 0) return -1;
+ RLM_MODULE_UNKNOWN, UNLANG_NEXT_STOP, top_frame) < 0) return -1;
frame = &stack->frame[stack->depth];
int unlang_interpret_push_function(request_t *request,
unlang_function_t func, unlang_function_t repeat,
- unlang_function_signal_t signal, void *uctx)
+ unlang_function_signal_t signal, bool top_frame, void *uctx)
CC_HINT(warn_unused_result);
#ifdef __cplusplus
}
}
- /*
- * Push a top frame, followed by a frame
- * which signals us that the child is
- * done, followed by the instruction to
- * run in the child.
- */
- if (unlang_interpret_push(child, NULL, RLM_MODULE_NOOP,
- UNLANG_NEXT_STOP, UNLANG_TOP_FRAME) < 0) goto error;
-
/*
* Child starts detached, the parent knows
* and can exit immediately once all
NULL,
unlang_parallel_child_done,
unlang_parallel_child_signal,
+ UNLANG_TOP_FRAME,
&state->children[i]) < 0) goto error;
child_frame = unlang_current_frame(child);
return_point_set(child_frame); /* Don't unwind this frame */
*/
if (unlang_interpret_push(child,
state->children[i].instruction, RLM_MODULE_FAIL,
- UNLANG_NEXT_STOP, UNLANG_SUB_FRAME) < 0) goto error;
+ UNLANG_NEXT_STOP,
+ state->detach ? UNLANG_TOP_FRAME : UNLANG_SUB_FRAME) < 0) goto error;
}
/*
/*
* Catch the interpreter on the way back up the stack
*/
- if (unlang_interpret_push_function(request, NULL, eap_tls_virtual_server_result, NULL, eap_session) < 0) {
+ if (unlang_interpret_push_function(request, NULL, eap_tls_virtual_server_result, NULL,
+ UNLANG_SUB_FRAME, eap_session) < 0) {
RETURN_MODULE_FAIL;
}