Module: kamailio
Branch: 5.8
Commit: 3c308f225414f1905bdffbfd4b3093ca22745696
URL: 
https://github.com/kamailio/kamailio/commit/3c308f225414f1905bdffbfd4b3093ca22745696

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-01-05T09:31:55+01:00

db_redis: use set max fetch for result to 1000 when *keys_count == 1000

- GH #4511

(cherry picked from commit 46737c269ae290c29639ab1a5e66e4cf1637556e)
(cherry picked from commit eba11b333d215d00d1b0ea0cd1597b5b4efabdae)

---

Modified: src/modules/db_redis/redis_dbase.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/3c308f225414f1905bdffbfd4b3093ca22745696.diff
Patch: 
https://github.com/kamailio/kamailio/commit/3c308f225414f1905bdffbfd4b3093ca22745696.patch

---

diff --git a/src/modules/db_redis/redis_dbase.c 
b/src/modules/db_redis/redis_dbase.c
index d6a4cb8580c..adfdaa2a471 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -1741,7 +1741,7 @@ static int db_redis_perform_query(const db1_con_t *_h, 
km_redis_con_t *con,
 
                max = 0;
                if(*keys_count == num_rows)
-                       max = (*keys_count) % 1000;
+                       max = (*keys_count == 1000) ? 1000 : *keys_count % 1000;
                else if(num_rows % 1000 == 0)
                        max = 1000;
 

_______________________________________________
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