未验证 提交 bfeda6a1 编写于 作者: O openharmony_ci 提交者: Gitee

!407 回退 'Pull Request !404 : DNS解析接口,在无网络情况下立刻返回'

Merge pull request !407 from openharmony_ci/revert-merge-404-master
......@@ -173,8 +173,7 @@ static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[
size_t l, dots;
char *p, *z;
int res = __get_resolv_conf(&conf, search, sizeof search);
if (res < 0) return res;
if (__get_resolv_conf(&conf, search, sizeof search) < 0) return -1;
/* Count dots, suppress search when >=ndots or name ends in
* a dot, which is an explicit request for global scope. */
......
......@@ -40,10 +40,12 @@ int __get_resolv_conf(struct resolvconf *conf, char *search, size_t search_sz)
dlclose(handle);
if (ret < 0) {
DNS_CONFIG_PRINT("__get_resolv_conf OHOS_GET_CONFIG_FUNC_NAME err %d\n", ret);
return EAI_NONAME;
goto etc_resolv_conf;
}
int32_t timeout_second = config.timeout_ms / 1000;
#endif
#if OHOS_DNS_PROXY_BY_NETSYS
netsys_conf:
if (timeout_second > 0) {
if (timeout_second >= 60) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册