diff options
author | Nishant Chaprana <n.chaprana@samsung.com> | 2019-09-17 19:00:55 +0530 |
---|---|---|
committer | Nishant Chaprana <n.chaprana@samsung.com> | 2019-09-18 19:23:41 +0530 |
commit | 26cc90dfaf2ad149b702626f9552c81abbb26862 (patch) | |
tree | 2524c8994cf58358350fde67dfba5c3b8cb58f7d /gweb/gresolv.c | |
parent | 9e3beb21876b6e63bd8acf53e751480d7a1cc16f (diff) | |
parent | 6b2381a2adabea7d8309ff158ef675ff88184305 (diff) | |
download | connman-26cc90dfaf2ad149b702626f9552c81abbb26862.tar.gz connman-26cc90dfaf2ad149b702626f9552c81abbb26862.tar.bz2 connman-26cc90dfaf2ad149b702626f9552c81abbb26862.zip |
Imported Upstream version 1.37submit/tizen/20190920.082459
Change-Id: Idb47c1ddbedc9f97181b8e9a5eeac04ddd832a2c
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
Diffstat (limited to 'gweb/gresolv.c')
-rwxr-xr-x | gweb/gresolv.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c index cf16a48c..38a554e0 100755 --- a/gweb/gresolv.c +++ b/gweb/gresolv.c @@ -28,6 +28,7 @@ #include <stdarg.h> #include <string.h> #include <stdlib.h> +#include <stdio.h> #include <resolv.h> #include <sys/types.h> #include <sys/socket.h> @@ -511,7 +512,7 @@ static void sort_and_return_results(struct resolv_lookup *lookup) status = lookup->ipv4_status; } - debug(lookup->resolv, "lookup %p received %d results", lookup, n); + debug(lookup->resolv, "lookup %p received %d results", lookup, n-1); g_queue_remove(lookup->resolv->lookup_queue, lookup); destroy_lookup(lookup); @@ -679,7 +680,10 @@ static void parse_response(struct resolv_nameserver *nameserver, switch (rcode) { case ns_r_noerror: - status = G_RESOLV_RESULT_STATUS_SUCCESS; + if (count > 0) + status = G_RESOLV_RESULT_STATUS_SUCCESS; + else + status = G_RESOLV_RESULT_STATUS_NO_ANSWER; break; case ns_r_formerr: status = G_RESOLV_RESULT_STATUS_FORMAT_ERROR; @@ -946,12 +950,10 @@ bool g_resolv_add_nameserver(GResolv *resolv, const char *address, nameserver->flags = flags; nameserver->resolv = resolv; - debug(resolv, ""); if (connect_udp_channel(nameserver) < 0) { free_nameserver(nameserver); return false; } - debug(resolv, ""); resolv->nameserver_list = g_list_append(resolv->nameserver_list, nameserver); @@ -1053,8 +1055,6 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, lookup->result_data = user_data; lookup->id = resolv->next_lookup_id++; - debug(resolv, ""); - if (resolv->result_family != AF_INET6) { if (add_query(lookup, hostname, ns_t_a)) { g_free(lookup); @@ -1062,8 +1062,6 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, } } - debug(resolv, ""); - if (resolv->result_family != AF_INET) { if (add_query(lookup, hostname, ns_t_aaaa)) { if (resolv->result_family != AF_INET6) { @@ -1077,8 +1075,6 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, } } - debug(resolv, ""); - g_queue_push_tail(resolv->lookup_queue, lookup); debug(resolv, "lookup %p id %d", lookup, lookup->id); |