{
unlang_frame_state_subrequest_t *state;
+ if (!request->parent) return;
+
+ state = talloc_get_type_abort(frame_current(request->parent)->state, unlang_frame_state_subrequest_t);
+
/*
- * Ignore signals which aren't detach,
+ * Ignore signals which aren't detach, and ar
* and ignore the signal if we have no parent.
*/
- if ((action != FR_SIGNAL_DETACH) || !request->parent) return;
+ switch (action) {
+ case FR_SIGNAL_DETACH:
+ /*
+ * Place child's state back inside the parent
+ */
+ if (state->session.enable) fr_state_store_in_parent(request,
+ state->session.unique_ptr,
+ state->session.unique_int);
+
+ if (!fr_cond_assert(unlang_subrequest_lifetime_set(request) == 0)) {
+ REDEBUG("Child could not be detached");
+ return;
+ }
+ FALL_THROUGH;
- state = talloc_get_type_abort(frame_current(request->parent), unlang_frame_state_subrequest_t);
+ case FR_SIGNAL_CANCEL:
+ /*
+ * Indicate to the parent there's no longer a child
+ */
+ state->child = NULL;
- /*
- * Place child's state back inside the parent
- */
- if (state->session.enable) fr_state_store_in_parent(request,
- state->session.unique_ptr,
- state->session.unique_int);
+ /*
+ * Tell the parent to resume
+ */
+ unlang_interpret_mark_runnable(request->parent);
+ break;
- if (!fr_cond_assert(unlang_subrequest_lifetime_set(request) == 0)) {
- REDEBUG("Child could not be detached");
+ default:
return;
}
-
- /*
- * Indicate to the parent there's no longer a child
- */
- state->child = NULL;
-
- /*
- * Tell the parent to resume
- */
- unlang_interpret_mark_runnable(request->parent);
}
/** When the child is done, tell the parent that we've exited.