diff --git a/debian/patches/series b/debian/patches/series index 425fe7f82..886b92d94 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -50,3 +50,4 @@ sipwise/avpops_avp_subst_pvar.patch sipwise/tt37692.patch sipwise/dtmf-blocking.patch sipwise/media-blocking.patch +sipwise/fix_db_redis_reconnect.patch diff --git a/debian/patches/sipwise/fix_db_redis_reconnect.patch b/debian/patches/sipwise/fix_db_redis_reconnect.patch new file mode 100644 index 000000000..533be9c50 --- /dev/null +++ b/debian/patches/sipwise/fix_db_redis_reconnect.patch @@ -0,0 +1,36 @@ +--- a/src/modules/db_redis/redis_connection.c ++++ b/src/modules/db_redis/redis_connection.c +@@ -390,7 +390,7 @@ + void db_redis_consume_replies(km_redis_con_t *con) { + redisReply *reply = NULL; + redis_key_t *query; +- while (con->append_counter > 0 && !con->con->err) { ++ while (con->append_counter > 0 && con->con && !con->con->err) { + LM_DBG("consuming outstanding reply %u", con->append_counter); + db_redis_get_reply(con, (void**)&reply); + if (reply) { +@@ -410,4 +410,4 @@ + } else { + return ""; + } +-} +\ No newline at end of file ++} +--- a/src/modules/db_redis/redis_connection.h ++++ b/src/modules/db_redis/redis_connection.h +@@ -35,6 +35,8 @@ + if (!(reply)) { \ + LM_ERR("Failed to fetch type entry: %s\n", \ + (con)->con->errstr); \ ++ redisFree((con)->con); \ ++ (con)->con = NULL; \ + goto err; \ + } \ + if ((reply)->type == REDIS_REPLY_ERROR) { \ +@@ -79,4 +81,4 @@ + void db_redis_free_reply(redisReply **reply); + const char *db_redis_get_error(km_redis_con_t *con); + +-#endif /* _REDIS_CONNECTION_H_ */ +\ No newline at end of file ++#endif /* _REDIS_CONNECTION_H_ */