Module: kamailio
Branch: 4.4
Commit: 6dbadcbc076a78c8ace46af3215a503084eab848
URL:
https://github.com/kamailio/kamailio/commit/6dbadcbc076a78c8ace46af3215a503…
Author: lazedo <luis.azedo(a)factorlusitano.com>
Committer: GitHub <noreply(a)github.com>
Date: 2017-01-18T13:09:12Z
Merge pull request #938 from kamailio/lazedo/kazoo-patch-44
kazoo: fix kz_amqp_get_zones
---
Modified: modules/kazoo/kz_amqp.c
Modified: modules/kazoo/kz_hash.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6dbadcbc076a78c8ace46af3215a503…
Patch:
https://github.com/kamailio/kamailio/commit/6dbadcbc076a78c8ace46af3215a503…
---
diff --git a/modules/kazoo/kz_amqp.c b/modules/kazoo/kz_amqp.c
index e4c0779..2b8a5e9 100644
--- a/modules/kazoo/kz_amqp.c
+++ b/modules/kazoo/kz_amqp.c
@@ -424,6 +424,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;
}
@@ -451,6 +452,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;
@@ -657,7 +659,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/modules/kazoo/kz_hash.c b/modules/kazoo/kz_hash.c
index 29da9bb..bb939e8 100644
--- a/modules/kazoo/kz_hash.c
+++ b/modules/kazoo/kz_hash.c
@@ -153,7 +153,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;
}
@@ -167,7 +167,7 @@ kz_amqp_cmd_ptr kz_cmd_retrieve(str* message_id)
}
if(prev_p->next== NULL)
{
- LM_ERR("command pointer not found\n");
+ LM_ERR("command pointer not found - %s\n", message_id->s);
lock_release(&kz_cmd_htable[hash_code].lock);
return NULL;
}