Module: kamailio
Branch: 5.1
Commit: 358f63a7a452923a28f7d5ea682c4dc9cde10d25
URL:
https://github.com/kamailio/kamailio/commit/358f63a7a452923a28f7d5ea682c4dc…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: Luis Azedo <luis(a)2600hz.com>
Date: 2018-02-09T23:20:58Z
kazoo: verify timer
(cherry picked from commit 00330db3864dbc7df20c76f413beb73a6d60189c)
---
Modified: src/modules/kazoo/kz_amqp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/358f63a7a452923a28f7d5ea682c4dc…
Patch:
https://github.com/kamailio/kamailio/commit/358f63a7a452923a28f7d5ea682c4dc…
---
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;