Module: kamailio
Branch: master
Commit: 9cfa6b7797cbfcf224cebc2514fa6758257fdccc
URL:
https://github.com/kamailio/kamailio/commit/9cfa6b7797cbfcf224cebc2514fa675…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: GitHub <noreply(a)github.com>
Date: 2017-01-18T13:09:02Z
Merge pull request #939 from kamailio/lazedo/kazoo-patch
kazoo: fix kz_amqp_get_zones
---
Modified: src/modules/kazoo/kz_amqp.c
Modified: src/modules/kazoo/kz_hash.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9cfa6b7797cbfcf224cebc2514fa675…
Patch:
https://github.com/kamailio/kamailio/commit/9cfa6b7797cbfcf224cebc2514fa675…
---
diff --git a/src/modules/kazoo/kz_amqp.c b/src/modules/kazoo/kz_amqp.c
index 61e3e3e..9c802aa 100644
--- a/src/modules/kazoo/kz_amqp.c
+++ b/src/modules/kazoo/kz_amqp.c
@@ -452,6 +452,7 @@ kz_amqp_zone_ptr kz_amqp_get_primary_zone() {
strcpy(kz_primary_zone->zone, dbk_primary_zone_name.s);
kz_primary_zone->zone[dbk_primary_zone_name.len] = '\0';
kz_primary_zone->servers = (kz_amqp_servers_ptr)
shm_malloc(sizeof(kz_amqp_servers));
+ memset(kz_primary_zone->servers, 0, sizeof(kz_amqp_servers));
}
return kz_primary_zone;
}
@@ -479,6 +480,7 @@ kz_amqp_zone_ptr kz_amqp_add_zone(char* zone) {
strcpy(zone_ptr->zone, zone);
zone_ptr->zone[strlen(zone)] = '\0';
zone_ptr->servers = (kz_amqp_servers_ptr) shm_malloc(sizeof(kz_amqp_servers));
+ memset(zone_ptr->servers, 0, sizeof(kz_amqp_servers));
kz_zones->tail->next = zone_ptr;
kz_zones->tail = zone_ptr;
return zone_ptr;
@@ -685,7 +687,7 @@ int kz_amqp_add_connection(modparam_t type, void* val)
url = ++ptr;
} else {
- zone_ptr = kz_amqp_get_primary_zone();
+ zone_ptr = kz_amqp_get_zones();
}
diff --git a/src/modules/kazoo/kz_hash.c b/src/modules/kazoo/kz_hash.c
index 16f92c2..00bea4e 100644
--- a/src/modules/kazoo/kz_hash.c
+++ b/src/modules/kazoo/kz_hash.c
@@ -181,7 +181,7 @@ kz_amqp_cmd_ptr kz_cmd_retrieve(str* message_id)
p = kz_search_cmd_table(message_id, hash_code);
if(p== NULL)
{
- LM_DBG("command pointer hash entry not found\n");
+ LM_DBG("command pointer hash entry not found - %s\n", message_id->s);
lock_release(&kz_cmd_htable[hash_code].lock);
return NULL;
}
@@ -195,7 +195,7 @@ kz_amqp_cmd_ptr kz_cmd_retrieve(str* message_id)
}
if(prev_p->next== NULL)
{
- LM_ERR("command pointer not found\n");
+ LM_DBG("command pointer hash entry not found - %s\n", message_id->s);
lock_release(&kz_cmd_htable[hash_code].lock);
return NULL;
}