Module: kamailio
Branch: 5.4
Commit: afc7f4c2e9c8c9176e655303fa1d949cbb4ecdec
URL:
https://github.com/kamailio/kamailio/commit/afc7f4c2e9c8c9176e655303fa1d949…
Author: Andrii Pogrebennyk <andrii(a)ng-voice.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-12-06T14:32:25+01:00
db_redis: don't leave unconsumed redis replies in case of error on update
Execute db_redis_consume_replies on failed update same as in db_redis_insert:
if db_redis_perform_update encounters an error it was leaving unconsumed data
thus causing unexpected reply later on when reading from the same connection.
(cherry picked from commit bbd7b2ed5827252680e9d8949c193699da0a76b2)
(cherry picked from commit 7b371b77702471e62d8bd2ee957c44df73f1db80)
---
Modified: src/modules/db_redis/redis_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/afc7f4c2e9c8c9176e655303fa1d949…
Patch:
https://github.com/kamailio/kamailio/commit/afc7f4c2e9c8c9176e655303fa1d949…
---
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index c9a25adf36..ac1bd2b946 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -2249,6 +2249,7 @@ static int db_redis_perform_update(const db1_con_t* _h,
km_redis_con_t *con, con
db_redis_key_free(&all_type_keys);
db_redis_key_free(&new_type_keys);
+ db_redis_consume_replies(con);
return 0;
error:
@@ -2260,6 +2261,7 @@ static int db_redis_perform_update(const db1_con_t* _h,
km_redis_con_t *con, con
db_redis_key_free(&type_keys);
db_redis_key_free(&set_keys);
db_redis_key_free(&new_type_keys);
+ db_redis_consume_replies(con);
return -1;
}