Skip to content

Commit 6025492

Browse files
committed
set_ttl with TTL=0 is a noop
1 parent 1d97565 commit 6025492

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/modules/rlm_cache/rlm_cache.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,11 @@ static unlang_action_t CC_HINT(nonnull) mod_method_ttl(unlang_result_t *p_result
13781378
ttl = inst->config.ttl; /* Set the default value from cache { ttl=... } */
13791379
vp = fr_pair_find_by_da(&request->control_pairs, NULL, attr_cache_ttl);
13801380
if (vp) {
1381-
if (vp->vp_int32 < 0) {
1381+
if (vp->vp_int32 == 0) {
1382+
p_result->rcode = RLM_MODULE_NOOP;
1383+
goto finish;
1384+
1385+
} else if (vp->vp_int32 < 0) {
13821386
ttl = fr_time_delta_from_sec(-(vp->vp_int32));
13831387
/* Updating the TTL */
13841388
} else {

0 commit comments

Comments
 (0)