Index: /branches/rel_apv_10_7_2/usr/click/lib/libdns_agent/dns_daemon.c
===================================================================
--- /branches/rel_apv_10_7_2/usr/click/lib/libdns_agent/dns_daemon.c	(revision 39289)
+++ /branches/rel_apv_10_7_2/usr/click/lib/libdns_agent/dns_daemon.c	(working copy)
@@ -431,7 +431,7 @@
 	volatile int *done = ctx->done;
 
 	// fastlog_syslog(LOG_DEBUG,"%s: Result: %d(%s), timeouts: %d", __FUNCTION__, status, ares_strerror(status), timeouts);
-	fastlog_syslog(LOG_DEBUG,"%s: rv: %d, t: %d", __FUNCTION__, status, timeouts);
+	// fastlog_syslog(LOG_DEBUG,"%s: rv: %d, t: %d", __FUNCTION__, status, timeouts);
 	if (result) {
 		struct ares_addrinfo_node *node = result->nodes;
 		*ttl = node->ai_ttl;
@@ -444,7 +444,7 @@
 }
 
 static int
-domain_resolve_asynch(char *host, webagent_dns_data_t *dns_data_p)
+domain_resolve_asynch(webagent_dns_data_t *dns_data_p)
 {
 	int free_idx = 0;
 	int ret;
@@ -454,7 +454,7 @@
 	struct ares_addrinfo_hints hints;
 	uint32_t ttl = 0;
 	volatile int done = 0;
-	dns_cb_ctx_t ctx = {
+	dns_cb_ctx_t ares_ctx = {
 		.ttl = &ttl,
 		.done = &done,
 	};
@@ -472,7 +472,7 @@
 		ulog_error_no_conn(AMP_ULOG_WEBAGENT, "run out of free requests");
 		return -1;
 	}
-	dns_req_wait_list[free_idx].req_item.ar_name = host;
+	dns_req_wait_list[free_idx].req_item.ar_name = dns_data_p->host;
 	dns_req_wait_list[free_idx].req_item.ar_service = NULL;
 	dns_req_wait_list[free_idx].req_item.ar_request = NULL; //hints will be default
 	dns_req_wait_list[free_idx].req_item.ar_result = NULL;
@@ -504,18 +504,17 @@
 		memset(&hints, 0, sizeof(hints));
 		hints.ai_family = AF_UNSPEC;
 		hints.ai_flags  = ARES_AI_CANONNAME;
-		ares_getaddrinfo(channel, host, NULL, &hints, addrinfo_cb, &ctx);
+		ares_getaddrinfo(channel, dns_data_p->host, NULL, &hints, addrinfo_cb, &ares_ctx);
 
 		int total_waited = 0;
 		while (!done && total_waited < 500) { // at most 0.5 sec
 			usleep(DNS_AGENT_SLEEP_TIME);     // 0.001 sec
 			total_waited += 1;
 		}
-		fastlog_syslog(LOG_DEBUG, "handle: %d", total_waited);
+		// fastlog_syslog(LOG_DEBUG, "handle: %d", total_waited);
 
-		if (!done)
-		{
-			fastlog_syslog(LOG_DEBUG, "%s callback timed out", host);
+		if (!done) {
+			fastlog_syslog(LOG_DEBUG, "%s callback timed out", dns_data_p->host);
 		}
 
 		ares_destroy(channel);
@@ -626,7 +625,7 @@
 	dns_data_p->thread_id = input_data_p->thread_id;
 
 	if (dns_nameserver_avail) {
-		ret = domain_resolve_asynch(input_data_p->host, dns_data_p);
+		ret = domain_resolve_asynch(dns_data_p);
 		if (ret) {
 			fastlog_syslog(LOG_DEBUG, "%s: failed to send DNS request", __FUNCTION__);
 			ulog_error_no_conn(AMP_ULOG_WEBAGENT, "failed to send DNS request");
