mirror of
https://github.com/sogou/workflow.git
synced 2026-10-28 19:19:22 +08:00
Merge pull request #531 from Barenboim/master
Fix problem when resolv.conf doesn't contain any nameserver.
This commit is contained in:
+8
-10
@@ -690,18 +690,16 @@ private:
|
||||
std::string url;
|
||||
std::string search;
|
||||
|
||||
if (__parse_resolv_conf(path, url, search, &ndots, &attempts,
|
||||
&rotate) >= 0)
|
||||
{
|
||||
client = new WFDnsClient;
|
||||
if (client->init(url, search, ndots, attempts, rotate) >= 0)
|
||||
return;
|
||||
__parse_resolv_conf(path, url, search, &ndots, &attempts, &rotate);
|
||||
if (url.size() == 0)
|
||||
url = "8.8.8.8";
|
||||
|
||||
delete client;
|
||||
client = NULL;
|
||||
}
|
||||
client = new WFDnsClient;
|
||||
if (client->init(url, search, ndots, attempts, rotate) >= 0)
|
||||
return;
|
||||
|
||||
abort();
|
||||
delete client;
|
||||
client = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user