1 Star 0 Fork 10

ultra_planet/elinks

forked from src-openEuler/elinks 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
elinks-0.11.0-getaddrinfo.patch 891 Bytes
一键复制 编辑 原始数据 按行查看 历史
fun_yang 提交于 2019-11-28 17:30 . package init
--- elinks-0.11.0/src/network/dns.c.getaddrinfo 2006-01-01 17:39:36.000000000 +0100
+++ elinks-0.11.0/src/network/dns.c 2006-01-10 09:30:56.000000000 +0100
@@ -157,9 +157,21 @@ do_real_lookup(unsigned char *name, struct sockaddr_storage **addrs, int *addrno
* But we duplicate the code terribly here :|. */
/* hostent = getipnodebyname(name, AF_INET6, AI_ALL | AI_ADDRCONFIG, NULL); */
memset(&hint, 0, sizeof(hint));
+ hint.ai_flags = AI_ADDRCONFIG;
hint.ai_family = AF_UNSPEC;
hint.ai_socktype = SOCK_STREAM;
- if (getaddrinfo(name, NULL, &hint, &ai) != 0) return DNS_ERROR;
+ switch (getaddrinfo(name, NULL, &hint, &ai))
+ {
+ case 0:
+ break;
+ case EAI_BADFLAGS:
+ hint.ai_flags = 0;
+ if (getaddrinfo(name, NULL, &hint, &ai) == 0)
+ break;
+ /* fall through */
+ default:
+ return DNS_ERROR;
+ }
#else
/* Seems there are problems on Mac, so we first need to try
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ultra_planet/elinks.git
git@gitee.com:ultra_planet/elinks.git
ultra_planet
elinks
elinks
master

搜索帮助