-
Notifications
You must be signed in to change notification settings - Fork 0
Integration Checklist
github-actions[bot] edited this page Jul 16, 2026
·
1 revision
把库链进驱动时需要落定的几件事:构建链接、调用约定、生命周期、信任与协议选型。
- 工具链:VS 2022 + 匹配的 WDK / SDK
- 链接
wknetlib.lib,附加包含目录指向include - 产品代码只包含
<wknet/Wknet.h>(或细分公共头),不包含src/wknetlib内部头 - Debug / Release 均视警告为错误
- 同步 HTTP / WebSocket / TLS / 证书路径在
PASSIVE_LEVEL调用 - 公共句柄经 Create 取得,经 Close / Release 释放;失败路径可无条件 Release(接受
nullptr) -
SendOptions/AsyncOptions等同为堆对象,使用对应 Create / Release - 检查
_Must_inspect_result_返回值
- 同主机请求复用同一
Session,便于连接池命中 -
Response与Request/AsyncOp生命周期独立,分别释放 - 使用过异步 API 时,在卸载路径调用
wknet::http::Destroy(),再拆除 WSK 等子系统 - WebSocket:
Close不与同句柄上新的收发并发;常见写法是单线程 连接 → 发 → 收 → 关 -
wknet::websocket::Receive的Message.Data指向内部缓冲,在下次收 / 关前有效
- 生产使用
CertPolicy::Verify,并提供调用方CertificateStore(信任锚 / pin) - 发布配置中不要保留
NoVerify - HTTPS→HTTP redirect 默认拒绝;跨源 redirect 会清理敏感头
- stale 连接失败时,仅
GET/HEAD/OPTIONS自动重试一次;POST 等不自动重放 - 强撤销:显式
RequireRevocationCheck,并提供可验证的 OCSP/CRL 证据
- 产品路径 Trace 默认
Off(需要时可调到 Info);不记录 body、Cookie、密钥、完整 URL query - 诊断时按组件过滤;生产避免全局 Max
- HTTP/3 默认
Auto;不需要时用Disabled,prior-knowledge 用Required - h2c、pipeline、0-RTT、permessage-deflate 等默认关闭,仅在明确需要时开启
- 支持范围与限制见 能力边界
日常用法见 Cookbook;语义见 会话与连接池、异步模型。
What to settle when linking the library into a driver: build, calling conventions, lifetime, trust, and protocol choices.
- Toolchain: VS 2022 with matching WDK / SDK
- Link
wknetlib.lib; additional include directory points atinclude - Product code includes only
<wknet/Wknet.h>(or fine-grained public headers), neversrc/wknetlibinternals - Debug / Release treat warnings as errors
- Sync HTTP / WebSocket / TLS / certificate paths run at
PASSIVE_LEVEL - Public handles come from Create and leave via Close / Release; failure paths may Release unconditionally (
nullptris fine) -
SendOptions/AsyncOptionsare heap objects too — matching Create / Release - Inspect
_Must_inspect_result_return values
- Reuse one
Sessionfor same-host requests so the pool can hit -
Responselifetime is independent ofRequest/AsyncOp— release each - After async APIs, call
wknet::http::Destroy()on the unload path, then tear down WSK and other subsystems - WebSocket: do not race
Closewith new I/O on the same handle; a common pattern is single-threaded connect → send → receive → close -
wknet::websocket::ReceiveMessage.Datapoints at an internal buffer valid until the next receive / close
- Production uses
CertPolicy::Verifywith a caller-suppliedCertificateStore(anchors / pins) - Do not leave
NoVerifyin release configuration - HTTPS→HTTP redirects are refused by default; cross-origin redirects strip sensitive headers
- On stale connection failure, only
GET/HEAD/OPTIONSauto-retry once; POST and similar methods are never auto-replayed - Hard revocation: explicit
RequireRevocationCheckplus verifiable OCSP/CRL evidence
- Product Trace defaults to
Off(Info when needed); do not log bodies, cookies, secrets, or full URL queries - Prefer component filters; avoid global Max in production
- HTTP/3 defaults to
Auto; useDisabledwhen unwanted,Requiredfor prior knowledge - h2c, pipelining, 0-RTT, permessage-deflate and other default-off features stay off until explicitly enabled
- Support scope and limits: Capability matrix
Recipes: Cookbook. Semantics: Session & pool, Async model.
-
开始使用 / Get Started
-
概念与行为 / Concepts
-
协议指南 / Protocols
-
API 参考 / API Reference
-
贡献与项目 / Contribute