From 3e296068bab730329d4dd8708b1cf9a530b13722 Mon Sep 17 00:00:00 2001 From: Vladimír Čunát Date: Mon, 28 Feb 2022 09:33:25 +0100 Subject: cache nit: reduce cache.max_ttl limit a bit The new limit is over 68 years, so still completely meaningless. --- daemon/bindings/cache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'daemon/bindings') diff --git a/daemon/bindings/cache.c b/daemon/bindings/cache.c index 3b14ed82..d3815175 100644 --- a/daemon/bindings/cache.c +++ b/daemon/bindings/cache.c @@ -130,10 +130,10 @@ static int cache_max_ttl(lua_State *L) lua_error_p(L, "expected 'max_ttl(number ttl)'"); uint32_t min = cache->ttl_min; int64_t ttl = lua_tointeger(L, 1); - if (ttl < 1 || ttl < min || ttl > UINT32_MAX) { + if (ttl < 1 || ttl < min || ttl > TTL_MAX_MAX) { lua_error_p(L, "max_ttl must be larger than minimum TTL, and in range <1, " - STR(UINT32_MAX) ">'"); + STR(TTL_MAX_MAX) ">'"); } cache->ttl_max = ttl; } @@ -152,10 +152,10 @@ static int cache_min_ttl(lua_State *L) lua_error_p(L, "expected 'min_ttl(number ttl)'"); uint32_t max = cache->ttl_max; int64_t ttl = lua_tointeger(L, 1); - if (ttl < 0 || ttl > max || ttl > UINT32_MAX) { + if (ttl < 0 || ttl > max || ttl > TTL_MAX_MAX) { lua_error_p(L, "min_ttl must be smaller than maximum TTL, and in range <0, " - STR(UINT32_MAX) ">'"); + STR(TTL_MAX_MAX) ">'"); } cache->ttl_min = ttl; } -- cgit v1.2.3