Skip to content

Add bounded HTTP and UDP tracker scrape support - #211

Closed
linroid wants to merge 2 commits into
torrent-v2-11-tracker-topicsfrom
torrent-v2-11-tracker-scrape
Closed

linroid wants to merge 2 commits into
torrent-v2-11-tracker-topicsfrom
torrent-v2-11-tracker-scrape

Conversation

@linroid

@linroid linroid commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Adds bounded HTTP and UDP tracker scrape for typed v1/v2 topics. HTTP derives the scrape path and preserves passkeys; UDP shares announce transaction/source validation, retry cookies, and cancellation cleanup. Results retain full topic keys, preserve missing HTTP entries as absent, and decode UDP counters as unsigned values.

Requests snapshot 1–50 topics before network suspension and reject duplicate wire identities. HTTP parsing is bounded to 64 KiB and 4096 nodes. Tests exercise actual IPv4/IPv6 UDP exchanges, spoofed/wrong-transaction replies, HTTP binary encoding, mutable input, malformed counts, timeout retries, and cancellation cleanup. Existing announce behavior is covered by the full regression suite.

Stacked on #210; advances #162. This exposes internal tracker protocol support; SDK controls, scrape scheduling/cache, network-policy admission, and independent tracker interoperability remain separate work.

Validation: 523 JVM and 502 executed iOS simulator tests, zero failures/errors/skips; native-runtime dependency guard and both pinned v1 conformance scenarios passed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-12T20:58:39.512997Z 7ae9ba5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7ae9ba53e6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

val path = parsed.encodedPath
require("announce" in path) { "Tracker has no derived scrape endpoint" }
val base = URLBuilder(url).apply {
encodedPath = path.replaceFirst("announce", "scrape")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Replace the final announce segment

When an announce URL contains announce in an earlier path segment, such as /announce-proxy/v1/announce.php, replaceFirst derives /scrape-proxy/v1/announce.php instead of the tracker’s conventional /announce-proxy/v1/scrape.php endpoint, so valid scrape requests are sent to the wrong route. Locate and replace the final eligible announce occurrence in the path instead.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2000bd7: scrape derivation replaces the final announce occurrence in the path. The regression uses /announce-proxy/v1/announce.php with a passkey, fails before the fix, and passes afterward. The combined child stack passed 530 JVM and 509 executed iOS tests, including the scrape and announce regressions.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

  712 files  + 5    712 suites  +5   4m 5s ⏱️ +3s
2 948 tests +24  2 948 ✅ +24  0 💤 ±0  0 ❌ ±0 
3 992 runs  +40  3 992 ✅ +40  0 💤 ±0  0 ❌ ±0 

Results for commit 2000bd7. ± Comparison against base commit c808a24.

@linroid

linroid commented Sep 20, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #237 (Tracker lifecycle, editing and discovery privacy) in the consolidated eight-PR stack for #162.

The replacement preserves this PR's code and subsequent fixes; its description links the original head and review discussions. The only additional consolidation fix is the CI-discovered listener cancellation regression, documented on the replacement. All eight replacements have passed their required CI checks.

Closing without merging. This branch and its discussions remain available for reference. Review index: #162 (comment)

@linroid linroid closed this Sep 20, 2026
@linroid
linroid deleted the torrent-v2-11-tracker-scrape branch September 20, 2026 11:13
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