Skip to content

Document that set_ssl_context() must outlive the client - #57

Merged
Antruly merged 1 commit into
masterfrom
fix/ssl-context-lifetime-doc
Oct 28, 2026
Merged

Antruly merged 1 commit into
masterfrom
fix/ssl-context-lifetime-doc

Conversation

@Antruly

@Antruly Antruly commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Companion to #56. The HTTP client stores the context as a raw pointer and its TLS session may use it while the client is destroyed; the current molink call site declared the context after the client, so it was freed first. This adds the lifetime requirement to the API docs. The underlying destructor crash still needs its own fix in #56.

`uvcpp_tcp_server`、`uvcpp_quic_server/client`、`uvcpp_ws_client`、
`uvcpp_web_ws_client` 与 `uvcpp_http_client` 是同一个裸指针契约:上下文必须比
持有它的对象活得久。补一句"同一作用域里先声明上下文、再声明本对象",并说明
反过来时析构收尾仍会用到这个指针 —— issue #56 的调用点正是这么写的。

(在本分支上重做:原提交基于 1.8.5 的行号,1.9.0 之后全部撞飞;这里只保留
语义增量,行号引用按 `check_doc_lines.py --update` 重新对齐。)
@Antruly
Antruly force-pushed the fix/ssl-context-lifetime-doc branch from 018532c to b2b6750 Compare October 28, 2026 19:00
@Antruly
Antruly merged commit 0fa0f6c into master Oct 28, 2026
47 of 49 checks passed
@Antruly
Antruly deleted the fix/ssl-context-lifetime-doc branch October 28, 2026 19:41
Antruly added a commit that referenced this pull request Oct 29, 2026
- 版本头 PATCH 1;两版 README 的徽章与 Version 行同步,"最新版本"改为 v1.9.1。
- CHANGELOG:三条主题条目(WebSocket 语义 / 横向扩展 / TLS 与网络)+ 新增
  v1.9.1 小节;当前源码树与 tag 清单同步。
- RELEASE.md:新增「v1.9.1 重点」,破坏性为**无**(只新增 API,C ABI 仍为 1)。

含自 v1.9.0 以来的三笔:#65(h3/h2 WS 帧回调里析构会话后的 UAF)、
#60(`uvcpp_udp_server(uvcpp_loop*)`,#59)、#57(五个 set_ssl_context 入口的
生命周期文档,issue #56),以及 `_local_deps` 误提交链接的清理。

本地:build-all 162/162、build-h3 120/120、build-default 60/60;文档门禁全绿;
release_notes.py --tag v1.9.1 能切出正文。
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.

1 participant