Skip to content

feat: 优化指纹探测并规范化 nil context#23

Open
wuchulonly wants to merge 3 commits into
chainreactors:masterfrom
wuchulonly:codex/sdk-local-changes-20260614
Open

feat: 优化指纹探测并规范化 nil context#23
wuchulonly wants to merge 3 commits into
chainreactors:masterfrom
wuchulonly:codex/sdk-local-changes-20260614

Conversation

@wuchulonly

@wuchulonly wuchulonly commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

变更

  • 优化 HTTP 主动指纹探测的请求特征、client/proxy 复用和匹配缓存。
  • stats 回调在 context 取消后直接跳过,避免 consumer 已关闭 channel 后继续发送。
  • 在各引擎 Context API 边界规范化 nil:WithContext(nil) 转为 context.Background()Context() 在 nil receiver 或底层 ctx 为 nil 时也返回 background。
  • 在 fingers/gogo/neutron/proton/zombie 的 Execute 入口处理 typed nil *Context 通过 types.Context 接口传入的情况。
  • 增加 nil context 与 typed nil Execute 回归测试。

为什么

这次不是只在 emitStats 做兜底 guard。空指针来源主要有两条:

  • 调用方执行 WithContext(nil),SDK Context 内部保存了 nil context.Context
  • Go 接口里包着 typed nil *Context 时,ctx == nil 为 false,类型断言后得到的 runCtx 仍然是 nil。

现在把这两条入口都收口成“SDK Context 不向外暴露 nil context.Context”,stats guard 只保留取消后的跳过语义。

测试

  • go test ./...

备注:VulnResult 导出结构已经在当前 master 中存在,本 PR 不再重复提交那部分。

@wuchulonly wuchulonly force-pushed the codex/sdk-local-changes-20260614 branch from 39b6ce1 to c71a822 Compare June 14, 2026 14:52
@wuchulonly wuchulonly changed the title feat: 优化指纹探测并导出漏洞结果 feat: 优化指纹探测并修复取消统计回调 Jun 14, 2026
@wuchulonly wuchulonly changed the title feat: 优化指纹探测并修复取消统计回调 feat: 优化指纹探测并规范化 nil context Jun 14, 2026
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