Skip to content

为 compat.curl 添加可选 HTTP/2 支持 - #970

Merged
Sunrisepeak merged 2 commits into
mcpplibs:mainfrom
helantianshen:add-compat-curl-http2
Dec 2, 2026
Merged

Sunrisepeak merged 2 commits into
mcpplibs:mainfrom
helantianshen:add-compat-curl-http2

Conversation

@helantianshen

@helantianshen helantianshen commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

变更说明

为 compat.curl 8.21.0 添加可选的 http2 特性。启用后,libcurl 编译 HTTP/2 支持,并通过 compat.nghttp2 1.71.0 处理 HTTP/2 帧和 HPACK。默认构建沿用现有依赖。Windows 上同步将 nghttp2 旧回调声明中的 ssize_t 设为指针宽度的 SSIZE_T,与 curl 的回调签名一致。

[dependencies.compat]
curl = { version = "8.21.0", features = ["http2"] }

验证

  • 默认消费用例确认 libcurl 未报告 HTTP/2。启用后的消费用例检查 CURL_VERSION_HTTP2,并设置 CURL_HTTP_VERSION_2TLS。
  • Linux 本地锁文件确认只有启用特性时才解析 nghttp2。
  • Mihomo C++ 使用同样的特性配方和官方 nghttp2,验证了直连及代理 DoH、HTTP/2 连接复用、HTTP/1.1 回退和证书校验。

合并影响

变更只涉及显式启用 http2 的消费工程。可以从依赖声明移除此特性来恢复默认构建。

@Sunrisepeak
Sunrisepeak merged commit 0df099c into mcpplibs:main Dec 2, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants