Module: kamailio
Branch: 5.0
Commit: 5a67316c102649e42f92256c18eb00c97d254f3a
URL:
https://github.com/kamailio/kamailio/commit/5a67316c102649e42f92256c18eb00c…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: Luis Azedo <luis(a)2600hz.com>
Date: 2018-02-09T23:21:29Z
kazoo: verify timer
(cherry picked from commit 00330db3864dbc7df20c76f413beb73a6d60189c)
---
Modified: src/modules/kazoo/kz_amqp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5a67316c102649e42f92256c18eb00c…
Patch:
https://github.com/kamailio/kamailio/commit/5a67316c102649e42f92256c18eb00c…
---
diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index 0dbf96158c..e04bdd3179 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);
}
@@ -3223,6 +3223,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);
@@ -3316,7 +3318,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;