Module: kamailio
Branch: master
Commit: 00330db3864dbc7df20c76f413beb73a6d60189c
URL: 
https://github.com/kamailio/kamailio/commit/00330db3864dbc7df20c76f413beb73a6d60189c

Author: lazedo <luis.az...@factorlusitano.com>
Committer: lazedo <luis.az...@factorlusitano.com>
Date: 2018-02-09T23:19:40Z

kazoo: verify timer

---

Modified: src/modules/kazoo/kz_amqp.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/00330db3864dbc7df20c76f413beb73a6d60189c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/00330db3864dbc7df20c76f413beb73a6d60189c.patch

---

diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index 5bc327be1d..affaad4eda 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -2659,10 +2659,10 @@ void kz_amqp_reconnect_cb(int fd, short event, void 
*arg)
 
        kz_amqp_timer_destroy(&connection->reconnect);
 
-//     if (connection->state == KZ_AMQP_CONNECTION_OPEN) {
-//             LM_WARN("trying to connect an already connected server.\n");
-//             return;
-//     }
+       if (connection->state == KZ_AMQP_CONNECTION_OPEN) {
+               LM_WARN("trying to connect an already connected server.\n");
+               return;
+       }
 
        kz_amqp_connect(connection);
 }
@@ -3235,6 +3235,8 @@ int kz_amqp_consumer_worker_proc(int cmd_pipe)
 
 void kz_amqp_timer_destroy(kz_amqp_timer_ptr* pTimer)
 {
+       if(!pTimer)
+               return;
        kz_amqp_timer_ptr timer = *pTimer;
        if (timer->ev != NULL) {
                event_del(timer->ev);
@@ -3328,7 +3330,6 @@ void kz_amqp_heartbeat_proc(int fd, short event, void 
*arg)
        LM_DBG("sending heartbeat to zone : %s , connection id : %d\n", 
connection->server->zone->zone, connection->server->id);
        if (connection->state != KZ_AMQP_CONNECTION_OPEN) {
                kz_amqp_timer_destroy(&connection->heartbeat);
-               kz_amqp_handle_server_failure(connection);
                return;
        }
        heartbeat.channel = 0;


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to