- Fix for #1253: Fix for redis cachedb backend to expect an integer

reply for the EXPIRE command.
This commit is contained in:
W.C.A. Wijngaards 2025-03-21 14:07:22 +01:00
parent a42fb99508
commit 0eabc8d0f1
2 changed files with 5 additions and 1 deletions

View 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); n = snprintf(cmdbuf, sizeof(cmdbuf), "SET %s %%b", key);
} else if(ttl == 0) { } else if(ttl == 0) {
/* use the EXPIRE command, SET with EX 0 is an invalid time. */ /* 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)", verbose(VERB_ALGO, "redis_store expire %s (%d bytes)",
key, (int)data_len); key, (int)data_len);
n = snprintf(cmdbuf, sizeof(cmdbuf), "EXPIRE %s 0", key); 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) { if(rep) {
verbose(VERB_ALGO, "redis_store set completed"); verbose(VERB_ALGO, "redis_store set completed");
if(rep->type != REDIS_REPLY_STATUS && 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)", log_err("redis_store: unexpected type of reply (%d)",
rep->type); rep->type);
} }

View file

@ -1,6 +1,8 @@
21 March 2025: Wouter 21 March 2025: Wouter
- Fix #1253: Cache entries fail to be removed from Redis cachedb - Fix #1253: Cache entries fail to be removed from Redis cachedb
backend with unbound-control flush* +c. 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 20 March 2025: Wouter
- Fix print of RR type NSAP-PTR, it is an unquoted string. - Fix print of RR type NSAP-PTR, it is an unquoted string.