Module: kamailio
Branch: master
Commit: 2025c2e395794333c91e90be81b7916abb82e93d
URL: 
https://github.com/kamailio/kamailio/commit/2025c2e395794333c91e90be81b7916abb82e93d

Author: Xenofon Karamanos <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-01-19T17:12:00+01:00

ndb_redis: always use redisGetReply

Pipelined redis response can be split across multiple network packets.
After calling redisGetReply once it is not guaranteed, that all response
packets have arrived and been read into the redis reader
buffer. If the next pipelined reply is requested before it has been
received from the network and processed into the redis reader buffer,
fetching the reply will fail.
Therefore, always use redisGetReply to ensure, that all replies
available in the network buffer are properly fed into the redis reply
reader.

---

Modified: src/modules/ndb_redis/redis_client.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2025c2e395794333c91e90be81b7916abb82e93d.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2025c2e395794333c91e90be81b7916abb82e93d.patch

---

diff --git a/src/modules/ndb_redis/redis_client.c 
b/src/modules/ndb_redis/redis_client.c
index 78a00cff6c5..99012f25ab7 100644
--- a/src/modules/ndb_redis/redis_client.c
+++ b/src/modules/ndb_redis/redis_client.c
@@ -932,8 +932,7 @@ int redisc_exec_pipelined(redisc_server_t *rsrv)
                        freeReplyObject(rpl->rplRedis);
                        rpl->rplRedis = NULL;
                }
-               if(redisGetReplyFromReader(rsrv->ctxRedis, (void 
**)&rpl->rplRedis)
-                               != REDIS_OK) {
+               if(redisGetReply(rsrv->ctxRedis, (void **)&rpl->rplRedis) != 
REDIS_OK) {
                        LM_ERR("Unable to read reply\n");
                        continue;
                }

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to