From: Alan T. DeKok Date: Thu, 19 Jan 2023 15:54:08 +0000 (-0500) Subject: note crappy code && todo's X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd23496d4db8a8c06bb11423cfb38a39955d66ca;p=thirdparty%2Ffreeradius-server.git note crappy code && todo's --- diff --git a/src/lib/unlang/module.c b/src/lib/unlang/module.c index bac24c94519..3913165e0a3 100644 --- a/src/lib/unlang/module.c +++ b/src/lib/unlang/module.c @@ -661,7 +661,6 @@ static unlang_action_t unlang_module_done(rlm_rcode_t *p_result, request_t *requ RDEBUG("%s (%s)", frame->instruction->name ? frame->instruction->name : "", fr_table_str_by_value(mod_rcode_table, rcode, "")); - request->rcode = rcode; if (state->p_result) *state->p_result = rcode; /* Inform our caller if we have one */ *p_result = rcode; request->module = state->previous_module; @@ -722,8 +721,6 @@ static unlang_action_t unlang_module_resume(rlm_rcode_t *p_result, request_t *re ua = resume(&state->rcode, MODULE_CTX(mc->instance->dl_inst, state->thread->data, state->rctx), request); safe_unlock(mc->instance); - request->rcode = state->rcode; - if (request->master_state == REQUEST_STOP_PROCESSING) ua = UNLANG_ACTION_STOP_PROCESSING; switch (ua) { diff --git a/src/lib/unlang/xlat_eval.c b/src/lib/unlang/xlat_eval.c index acc815d70c3..f0c70436749 100644 --- a/src/lib/unlang/xlat_eval.c +++ b/src/lib/unlang/xlat_eval.c @@ -593,11 +593,18 @@ xlat_action_t xlat_eval_one_letter(TALLOC_CTX *ctx, FR_DLIST_HEAD(fr_value_box_l */ case 'c': /* Current epoch time seconds */ + /* + * @todo - leave this as FR_TYPE_DATE, but add an enumv which changes the scale to + * seconds? + */ MEM(value = fr_value_box_alloc(ctx, FR_TYPE_UINT64, NULL, false)); value->datum.uint64 = (uint64_t)fr_time_to_sec(fr_time()); break; case 'C': /* Current epoch time microsecond component */ + /* + * @todo - we probably should remove this now that we have FR_TYPE_DATE with scaling. + */ MEM(value = fr_value_box_alloc(ctx, FR_TYPE_UINT64, NULL, false)); value->datum.uint64 = (uint64_t)fr_time_to_usec(fr_time()) % 1000000; break; @@ -648,6 +655,10 @@ xlat_action_t xlat_eval_one_letter(TALLOC_CTX *ctx, FR_DLIST_HEAD(fr_value_box_l break; case 'l': /* Request timestamp as seconds since the epoch */ + /* + * @todo - leave this as FR_TYPE_DATE, but add an enumv which changes the scale to + * seconds? + */ MEM(value = fr_value_box_alloc(ctx, FR_TYPE_UINT64, NULL, false)); value->datum.uint64 = (uint64_t ) now; break; @@ -660,6 +671,9 @@ xlat_action_t xlat_eval_one_letter(TALLOC_CTX *ctx, FR_DLIST_HEAD(fr_value_box_l break; case 'M': /* Request time microsecond component */ + /* + * @todo - we probably should remove this now that we have FR_TYPE_DATE with scaling. + */ MEM(value = fr_value_box_alloc(ctx, FR_TYPE_UINT32, NULL, false)); value->datum.uint32 = fr_time_to_msec(request->packet->timestamp) % 1000; break;