break;
}
+ /*
+ * If we're running a real request, then the final
+ * indentation MUST be zero. Otherwise we skipped
+ * something!
+ *
+ * Also check that the request is NOT marked as
+ * "yielded", but is in fact done.
+ *
+ * @todo - check that the stack is at frame 0, otherwise
+ * more things have gone wrong.
+ */
+ fr_assert(request->parent || (request->log.unlang_indent == 0));
+ fr_assert(!unlang_interpret_is_resumable(request));
+
RDEBUG("Done request");
/*
return stack->result;
}
+/** Check if a request as resumable.
+ *
+ * @param[in] request The current request.
+ * @return
+ * - true if the request is resumable (i.e. has yeilded)
+ * - false if the request is not resumable (i.e. has not yielded)
+ */
+bool unlang_interpret_is_resumable(request_t *request)
+{
+ unlang_stack_t *stack = request->stack;
+ unlang_stack_frame_t *frame = &stack->frame[stack->depth];
+
+ return is_yielded(frame);
+}
+
/** Mark a request as resumable.
*
* It's not called "unlang_interpret", because it doesn't actually
void unlang_interpret_mark_resumable(request_t *request);
+bool unlang_interpret_is_resumable(request_t *request);
+
void unlang_interpret_signal(request_t *request, fr_state_signal_t action);
int unlang_interpret_stack_depth(request_t *request);