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

!404 DNS解析接口,在无网络情况下立刻返回

Merge pull request !404 from maosiping/master
......@@ -173,7 +173,8 @@ static int name_from_dns_search(struct address buf[static MAXADDRS], char canon[
size_t l, dots;
char *p, *z;
if (__get_resolv_conf(&conf, search, sizeof search) < 0) return -1;
int res = __get_resolv_conf(&conf, search, sizeof search);
if (res < 0) return res;
/* Count dots, suppress search when >=ndots or name ends in
* a dot, which is an explicit request for global scope. */
......
......@@ -40,12 +40,10 @@ 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);
goto etc_resolv_conf;
return EAI_NONAME;
}
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.
先完成此消息的编辑!
想要评论请 注册