Reconsider usages of `gethostbyname_r()`
未关闭
还没有人认领这个 Issue。
Category: Engine
Refactoring
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.2k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
Description
According to some sources, this function is obsolete and should be replaced with:
Applications should use getaddrinfo(3), getnameinfo(3), and gai_strerror(3) instead.
Moreover, getting rid of them would allow us to get remove some conditionally defined globals:
https://github.com/php/php-src/blob/69d9c12df64e829befd843175bfc9617aabb7450/ext/standard/file.h#L106-L110
Initially found while working on #15511
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
在仓库中搜索 gethostbyname_r() 的使用位置,并阅读第 106-110 行附近的 ext/standard/file.h,以及 #15511 中的上下文。将每个使用位置与 getaddrinfo()、getnameinfo() 和 gai_strerror() 进行比较;完成的标准是已一致地处理废弃的调用和不再需要的条件全局变量。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- c
- 领域
- networking
- Issue 类型
- 重构
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100