set_with_ex_fail:
log_err("redis_init: failure during redis_init, the "
"redis-expire-records option requires the SET with EX command "
- "(redis >= 2.6.2)");
+ "(redis >= 2.6.12)");
return 1;
fail:
moddata_clean(&moddata);
char* key, struct sldns_buffer* result_buffer)
{
redisReply* rep;
- char cmdbuf[4+(CACHEDB_HASHSIZE/8)*2+1]; /* "GET " + key */
+ /* Supported commands:
+ * - "GET " + key
+ */
+#define REDIS_LOOKUP_MAX_BUF_LEN \
+ 4 /* "GET " */ \
+ +(CACHEDB_HASHSIZE/8)*2 /* key hash */ \
+ + 1 /* \0 */
+ char cmdbuf[REDIS_LOOKUP_MAX_BUF_LEN];
int n;
int ret = 0;
* older redis 2.0.0 was "SETEX " + key + " " + ttl + " %b"
* - "EXPIRE " + key + " 0"
*/
- char cmdbuf[6+(CACHEDB_HASHSIZE/8)*2+11+3+1];
+#define REDIS_STORE_MAX_BUF_LEN \
+ 7 /* "EXPIRE " */ \
+ +(CACHEDB_HASHSIZE/8)*2 /* key hash */ \
+ + 7 /* " %b EX " */ \
+ + 20 /* ttl (uint64_t) */ \
+ + 1 /* \0 */
+ char cmdbuf[REDIS_STORE_MAX_BUF_LEN];
if (!set_ttl) {
verbose(VERB_ALGO, "redis_store %s (%d bytes)", key, (int)data_len);
+8 September 2025: Yorgos
+ - Update documentation for using "SET ... EX" in Redis.
+ - Document max buffer sizes for Redis commands.
+
3 September 2025: Wouter
- For #1328: make depend.
internally reverted to "no".
.. note::
- Redis SETEX support is required for this option (Redis >= 2.0.0).
+ Redis "SET ... EX" support is required for this option (Redis >= 2.6.12).
Default: no