JakeChampion / JakeChampion/trafficserver
[10.2][api] Duplicate TSHttpTxnIntercept leaks the prior PluginVCCore and strands the first interceptor
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 0
- Forks
- 0
- Avg merge
- 8h 2m
- Merged PRs (30d)
- 21
Description
Branch: 10.2.x (10.2.1, commit 31f1f2f3b) · Severity: medium
Location: src/api/InkAPI.cc:6117 (and :6132)
What's wrong
TSHttpTxnServerIntercept / TSHttpTxnIntercept overwrite http_sm->plugin_tunnel unconditionally. If a transaction is intercepted twice (two plugins, or one buggy plugin), the previously stored PluginVCCore is orphaned — HttpSM only ever frees the current pointer — so the first core leaks and the first plugin's accept continuation never fires. There is no diagnostic for this misuse.
Fix
If plugin_tunnel is already set, log an error and ignore the second intercept. PR attached.
Testing
Compiles cleanly on 10.2.x (libtsapi.so builds). clang-format clean.
From an automated multi-lens audit of the 10.2.x branch. Full report on branch claude/codebase-audit-review-9nw7vz (CODEBASE_AUDIT_10.2.md).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/api/InkAPI.cc:6117 and :6132, reading the TSHttpTxnServerIntercept and TSHttpTxnIntercept entry points and how plugin_tunnel is owned. Verify the duplicate-intercept path preserves the existing interceptor, reports the misuse, and leaves the API build and clang-format checks clean.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100