Module: kamailio
Branch: 5.5
Commit: 7b371b77702471e62d8bd2ee957c44df73f1db80
URL:
https://github.com/kamailio/kamailio/commit/7b371b77702471e62d8bd2ee957c44d…
Author: Andrii Pogrebennyk <andrii(a)ng-voice.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-12-06T14:24:45+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)
---
Modified: src/modules/db_redis/redis_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7b371b77702471e62d8bd2ee957c44d…
Patch:
https://github.com/kamailio/kamailio/commit/7b371b77702471e62d8bd2ee957c44d…
---
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index c9a25adf36d..ac1bd2b9467 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;
}