]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix for #1253: Fix for redis cachedb backend to expect an integer
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 21 Mar 2025 13:07:22 +0000 (14:07 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 21 Mar 2025 13:07:22 +0000 (14:07 +0100)
  reply for the EXPIRE command.

cachedb/redis.c
doc/Changelog

index c38bcaa14f4ce113f2a0557791cb39f8ec8d454e..183879dd00af5bbdbe332b20e5f0c77741842dcb 100644 (file)
@@ -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);
                }
index 7b98f440a5c5b0e59dd9723d0303dfefbed0c09d..0400c54cdadecbe8fa51c33b73d3ce124da4f285 100644 (file)
@@ -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.