]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
note crappy code && todo's
authorAlan T. DeKok <aland@freeradius.org>
Thu, 19 Jan 2023 15:54:08 +0000 (10:54 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 19 Jan 2023 15:54:08 +0000 (10:54 -0500)
src/lib/unlang/module.c
src/lib/unlang/xlat_eval.c

index bac24c9451985bbff59017a76ebe36db80dfd976..3913165e0a324cc65f50f235904dc965cfb92622 100644 (file)
@@ -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, "<invalid>"));
 
-       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) {
index acc815d70c3a47254952cae3ef7bf5e0fd6a6287..f0c7043674928bac7e35b777b6b0a0992b50f5f8 100644 (file)
@@ -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;