mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-10 06:13:20 -05:00
- Update documentation for using "SET ... EX" in Redis.
- Document max buffer sizes for Redis commands.
This commit is contained in:
parent
5588f66bdb
commit
a72177e73c
3 changed files with 21 additions and 4 deletions
|
|
@ -392,7 +392,7 @@ redis_init(struct module_env* env, struct cachedb_env* cachedb_env)
|
|||
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);
|
||||
|
|
@ -508,7 +508,14 @@ redis_lookup(struct module_env* env, struct cachedb_env* cachedb_env,
|
|||
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;
|
||||
|
||||
|
|
@ -568,7 +575,13 @@ redis_store(struct module_env* env, struct cachedb_env* cachedb_env,
|
|||
* 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);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
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.
|
||||
|
||||
|
|
|
|||
|
|
@ -4495,7 +4495,7 @@ The following **cachedb:** options are specific to the ``redis`` backend.
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue