From: Arran Cudbard-Bell Date: Sat, 20 Jan 2018 18:52:23 +0000 (-0700) Subject: They're frame states not stack states X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dc0e0abe64cb3e87670cc5e9b8657e07ee8caff;p=thirdparty%2Ffreeradius-server.git They're frame states not stack states --- diff --git a/src/main/unlang_interpret.c b/src/main/unlang_interpret.c index 318186c2478..60d5b061408 100644 --- a/src/main/unlang_interpret.c +++ b/src/main/unlang_interpret.c @@ -816,7 +816,7 @@ void *unlang_stack_alloc(TALLOC_CTX *ctx) * This number is pretty arbitrary, but it seems * like too low level to make into a tuneable. */ - return talloc_pooled_object(ctx, unlang_stack_t, UNLANG_STACK_MAX / 4, sizeof(unlang_stack_state_t)); + return talloc_pooled_object(ctx, unlang_stack_t, UNLANG_STACK_MAX / 4, sizeof(unlang_frame_state_t)); #else return talloc_zero(ctx, unlang_stack_t); #endif @@ -965,8 +965,8 @@ int unlang_event_timeout_add(REQUEST *request, fr_unlang_module_timeout_t callba unlang_stack_frame_t *frame = &stack->frame[stack->depth]; unlang_event_t *ev; unlang_module_call_t *sp; - unlang_stack_state_modcall_t *ms = talloc_get_type_abort(frame->state, - unlang_stack_state_modcall_t); + unlang_frame_state_modcall_t *ms = talloc_get_type_abort(frame->state, + unlang_frame_state_modcall_t); rad_assert(stack->depth > 0); rad_assert((frame->instruction->type == UNLANG_TYPE_MODULE_CALL) || @@ -1047,8 +1047,8 @@ int unlang_event_fd_add(REQUEST *request, unlang_stack_frame_t *frame = &stack->frame[stack->depth]; unlang_event_t *ev; unlang_module_call_t *sp; - unlang_stack_state_modcall_t *ms = talloc_get_type_abort(frame->state, - unlang_stack_state_modcall_t); + unlang_frame_state_modcall_t *ms = talloc_get_type_abort(frame->state, + unlang_frame_state_modcall_t); rad_assert(stack->depth > 0); diff --git a/src/main/unlang_op.c b/src/main/unlang_op.c index db1560510f7..dea019f8886 100644 --- a/src/main/unlang_op.c +++ b/src/main/unlang_op.c @@ -1532,7 +1532,7 @@ static unlang_action_t unlang_module_call(REQUEST *request, unlang_stack_t *stack = request->stack; unlang_stack_frame_t *frame = &stack->frame[stack->depth]; unlang_t *instruction = frame->instruction; - unlang_stack_state_modcall_t *ms; + unlang_frame_state_modcall_t *ms; #ifndef NDEBUG int unlang_indent = request->log.unlang_indent; @@ -1556,7 +1556,7 @@ static unlang_action_t unlang_module_call(REQUEST *request, goto done; } - frame->state = ms = talloc_zero(stack, unlang_stack_state_modcall_t); + frame->state = ms = talloc_zero(stack, unlang_frame_state_modcall_t); /* * Grab the thread/module specific data if any exists. @@ -1625,7 +1625,7 @@ static void unlang_module_signal(REQUEST *request, void *rctx, fr_state_signal_t unlang_resume_t *mr; unlang_module_call_t *mc; - unlang_stack_state_modcall_t *ms = NULL; + unlang_frame_state_modcall_t *ms = NULL; rad_assert(stack->depth > 0); @@ -1635,7 +1635,7 @@ static void unlang_module_signal(REQUEST *request, void *rctx, fr_state_signal_t if (!mr->signal) return; mc = unlang_generic_to_module_call(mr->parent); - ms = talloc_get_type_abort(frame->state, unlang_stack_state_modcall_t); + ms = talloc_get_type_abort(frame->state, unlang_frame_state_modcall_t); ((fr_unlang_module_signal_t)mr->signal)(request, mc->module_instance->dl_inst->data, ms->thread->data, @@ -1650,11 +1650,11 @@ static unlang_action_t unlang_module_resume(REQUEST *request, rlm_rcode_t *presu unlang_resume_t *mr = unlang_generic_to_resume(instruction); unlang_module_call_t *mc = unlang_generic_to_module_call(mr->parent); - unlang_stack_state_modcall_t *ms = NULL; + unlang_frame_state_modcall_t *ms = NULL; rad_assert(mr->parent->type == UNLANG_TYPE_MODULE_CALL); - ms = talloc_get_type_abort(frame->state, unlang_stack_state_modcall_t); + ms = talloc_get_type_abort(frame->state, unlang_frame_state_modcall_t); /* * Lock is noop unless instance->mutex is set. diff --git a/src/main/unlang_priv.h b/src/main/unlang_priv.h index 35f082616a9..39499bd1c40 100644 --- a/src/main/unlang_priv.h +++ b/src/main/unlang_priv.h @@ -224,7 +224,7 @@ typedef struct { */ typedef struct { module_thread_instance_t *thread; //!< thread-local data for this module -} unlang_stack_state_modcall_t; +} unlang_frame_state_modcall_t; /** State of a foreach loop * @@ -239,7 +239,7 @@ typedef struct { #ifndef NDEBUG int indent; //!< for catching indentation issues #endif -} unlang_stack_state_foreach_t; +} unlang_frame_state_foreach_t; /** State of a redundant operation * @@ -247,7 +247,7 @@ typedef struct { typedef struct { unlang_t *child; unlang_t *found; -} unlang_stack_state_redundant_t; +} unlang_frame_state_redundant_t; /** Our interpreter stack, as distinct from the C stack * @@ -291,8 +291,8 @@ typedef struct { bool top_frame : 1; //!< are we the top frame of the stack? union { - unlang_stack_state_foreach_t foreach; //!< Foreach iterator state. - unlang_stack_state_redundant_t redundant; //!< Redundant section state. + unlang_frame_state_foreach_t foreach; //!< Foreach iterator state. + unlang_frame_state_redundant_t redundant; //!< Redundant section state. }; } unlang_stack_frame_t; diff --git a/src/main/xlat_unlang.c b/src/main/xlat_unlang.c index fecfb579a7f..e8ce167b38f 100644 --- a/src/main/xlat_unlang.c +++ b/src/main/xlat_unlang.c @@ -38,7 +38,7 @@ RCSID("$Id$") typedef struct { fr_value_box_t *result; //!< Where to store the result of the ///< xlat expansion. This is usually discarded. -} unlang_stack_state_xlat_inline_t; +} unlang_frame_state_xlat_inline_t; /** State of an xlat expansion * @@ -58,7 +58,7 @@ typedef struct { ///< asynchronous xlat functions. bool alternate; //!< record which alternate branch we ///< previously took. -} unlang_stack_state_xlat_t; +} unlang_frame_state_xlat_t; /** Static instruction for performing xlat evaluations * @@ -93,7 +93,7 @@ void xlat_unlang_push(TALLOC_CTX *ctx, fr_value_box_t **out, REQUEST *request, xlat_exp_t const *exp, bool top_frame) { - unlang_stack_state_xlat_t *state; + unlang_frame_state_xlat_t *state; unlang_stack_t *stack = request->stack; unlang_stack_frame_t *frame; @@ -106,7 +106,7 @@ void xlat_unlang_push(TALLOC_CTX *ctx, fr_value_box_t **out, /* * Allocate its state, and setup a cursor for the xlat nodes */ - frame->state = state = talloc_zero(stack, unlang_stack_state_xlat_t); + frame->state = state = talloc_zero(stack, unlang_frame_state_xlat_t); state->exp = exp; fr_cursor_init(&state->values, out); @@ -124,7 +124,7 @@ static unlang_action_t xlat_unlang(REQUEST *request, { unlang_stack_t *stack = request->stack; unlang_stack_frame_t *frame = &stack->frame[stack->depth]; - unlang_stack_state_xlat_t *xs = talloc_get_type_abort(frame->state, unlang_stack_state_xlat_t); + unlang_frame_state_xlat_t *xs = talloc_get_type_abort(frame->state, unlang_frame_state_xlat_t); xlat_exp_t const *child = NULL; xlat_action_t xa; @@ -233,7 +233,7 @@ static unlang_action_t xlat_unlang_resume(REQUEST *request, rlm_rcode_t *presult unlang_stack_frame_t *frame = &stack->frame[stack->depth]; unlang_t *instruction = frame->instruction; unlang_resume_t *mr = unlang_generic_to_resume(instruction); - unlang_stack_state_xlat_t *xs = talloc_get_type_abort(frame->state, unlang_stack_state_xlat_t); + unlang_frame_state_xlat_t *xs = talloc_get_type_abort(frame->state, unlang_frame_state_xlat_t); xlat_action_t xa; xa = xlat_frame_eval_resume(xs->ctx, &xs->values, mr->callback, xs->exp, request, &xs->result, rctx); @@ -274,9 +274,9 @@ static unlang_action_t xlat_unlang_inline(REQUEST *request, if (!mx->exec) { TALLOC_CTX *pool; - unlang_stack_state_xlat_inline_t *state; + unlang_frame_state_xlat_inline_t *state; - MEM(frame->state = state = talloc_zero(stack, unlang_stack_state_xlat_inline_t)); + MEM(frame->state = state = talloc_zero(stack, unlang_frame_state_xlat_inline_t)); MEM(pool = talloc_pool(frame->state, 1024)); /* Pool to absorb some allocs */ xlat_unlang_push(pool, &state->result, request, mx->exp, false);