X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fdnsproxy.c;h=58d1bfe2c3741f94a8f2c28accededb2a88d8e06;hb=335e7562aafe49d4f91184ebe4d84d1aa99b9ca7;hp=71efe6af345940c48b9ac8d84deac70ee51678cb;hpb=aab0baede4eca5fa5d539bf0cffcb712f0453486;p=framework%2Fconnectivity%2Fconnman.git diff --git a/src/dnsproxy.c b/src/dnsproxy.c index 71efe6a..58d1bfe 100644 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -1791,6 +1791,7 @@ hangup: if ((condition & G_IO_OUT) && !server->connected) { GSList *list; GList *domains; + int no_request_sent = TRUE; struct server_data *udp_server; udp_server = find_server(server->interface, server->server, @@ -1818,6 +1819,7 @@ hangup: for (list = request_list; list; ) { struct request_data *req = list->data; + int status; if (req->protocol == IPPROTO_UDP) { list = list->next; @@ -1826,8 +1828,9 @@ hangup: DBG("Sending req %s over TCP", (char *)req->name); - if (ns_resolv(server, req, - req->request, req->name) > 0) { + status = ns_resolv(server, req, + req->request, req->name); + if (status > 0) { /* * A cached result was sent, * so the request can be released @@ -1838,6 +1841,13 @@ hangup: continue; } + if (status < 0) { + list = list->next; + continue; + } + + no_request_sent = FALSE; + if (req->timeout > 0) g_source_remove(req->timeout); @@ -1846,6 +1856,11 @@ hangup: list = list->next; } + if (no_request_sent == TRUE) { + destroy_server(server); + return FALSE; + } + } else if (condition & G_IO_IN) { struct partial_reply *reply = server->incoming_reply; int bytes_recv;