From 0eabc8d0f123f7b9d65cfe46935f04cb10ae1d50 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Fri, 21 Mar 2025 14:07:22 +0100 Subject: [PATCH] - Fix for #1253: Fix for redis cachedb backend to expect an integer reply for the EXPIRE command. --- cachedb/redis.c | 4 +++- doc/Changelog | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cachedb/redis.c b/cachedb/redis.c index c38bcaa14..183879dd0 100644 --- a/cachedb/redis.c +++ b/cachedb/redis.c @@ -369,6 +369,7 @@ redis_store(struct module_env* env, struct cachedb_env* cachedb_env, n = snprintf(cmdbuf, sizeof(cmdbuf), "SET %s %%b", key); } else if(ttl == 0) { /* use the EXPIRE command, SET with EX 0 is an invalid time. */ + /* Replies with REDIS_REPLY_INTEGER of 1. */ verbose(VERB_ALGO, "redis_store expire %s (%d bytes)", key, (int)data_len); n = snprintf(cmdbuf, sizeof(cmdbuf), "EXPIRE %s 0", key); @@ -394,7 +395,8 @@ redis_store(struct module_env* env, struct cachedb_env* cachedb_env, if(rep) { verbose(VERB_ALGO, "redis_store set completed"); if(rep->type != REDIS_REPLY_STATUS && - rep->type != REDIS_REPLY_ERROR) { + rep->type != REDIS_REPLY_ERROR && + rep->type != REDIS_REPLY_INTEGER) { log_err("redis_store: unexpected type of reply (%d)", rep->type); } diff --git a/doc/Changelog b/doc/Changelog index 7b98f440a..0400c54cd 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,8 @@ 21 March 2025: Wouter - Fix #1253: Cache entries fail to be removed from Redis cachedb backend with unbound-control flush* +c. + - Fix for #1253: Fix for redis cachedb backend to expect an integer + reply for the EXPIRE command. 20 March 2025: Wouter - Fix print of RR type NSAP-PTR, it is an unquoted string. -- 2.47.3