Skip to content

shim: IP filter + streaming deadlines + extended add (ABI v8) — roadmap finale#21

Merged
SethMorrowSoftware merged 1 commit into
mainfrom
claude/relaxed-cerf-816pyn
Jun 27, 2026
Merged

shim: IP filter + streaming deadlines + extended add (ABI v8) — roadmap finale#21
SethMorrowSoftware merged 1 commit into
mainfrom
claude/relaxed-cerf-816pyn

Conversation

@SethMorrowSoftware

Copy link
Copy Markdown
Owner

Batch 5 — the finale of surfacing more of libtorrent. Privacy filtering, streaming, and add-time configuration.

New ABI (v7 → v8, append-only)

btx_* bt* what
ip_filter_add / ip_filter_clear btIpFilterAdd / btIpFilterClear block/allow inclusive IP ranges (rules accumulate; same-family v4/v6)
set_piece_deadline / clear_piece_deadlines btSetPieceDeadline / btClearPieceDeadlines streaming — fetch a piece by a ms deadline, soonest-first
add_magnet_ex / add_torrent_file_ex btAddMagnetEx / btAddTorrentFileEx the plain add path plus add-time torrent_flags

69 → 75 public handlers.

Design notes

  • IP filter does a read-modify-write of the session filter (get_ip_filteradd_ruleset_ip_filter) so rules accumulate; addresses parsed with lt::make_address (rejects mixed v4/v6 ranges).
  • Extended add shares one apply_add_flags helper — set the masked bits, default the rest. Headline use: add PAUSED so you can set file priorities before download starts (you can't do that atomically post-add), or sequential for immediate streaming.
  • No record-schema change this batch.

Verification

  • C++: built + run under gcc ASan/UBSan against real libtorrent — 549 checks, 0 failures, clean -Wall -Wextra.
  • Static gates green: check-livecodescript 7/7; check-record-registry 101 in sync (incl. the ABI cross-check, now confirming 8↔8); golden OK.
  • README + api-reference updated. CI rebuilds the committed binaries on merge.

This completes the expansion

Across this run the binding grew 39 → 75 public handlers, ABI v3 → v8:

  • v4 torrent_flags / caps / queue / storage-move / scrape
  • v5 file table + piece availability
  • v6 tracker & web-seed editing/listing
  • v7 session ops (pause/listen-port/find-by-hash/dht-announce) + an ABI-skew static gate
  • v8 IP filter + streaming deadlines + extended add

Optional follow-ons (not in this PR): DHT get_peers with its reply alert, peer_blocked event surfacing, per-tracker scrape/error detail.

🤖 Generated with Claude Code

https://claude.ai/code/session_01371AXB4CUUke7enHHS8okc


Generated by Claude Code

Batch 5, the finale of surfacing more of libtorrent: privacy filtering,
streaming, and add-time configuration.

New btx_* ABI (v7 -> v8, append-only):
- btx_ip_filter_add / btx_ip_filter_clear - block (or allow) inclusive IP
  ranges; rules accumulate via a read-modify-write of the session filter.
  Same-family ranges (v4 or v6), parsed with lt::make_address.
- btx_set_piece_deadline / btx_clear_piece_deadlines - streaming: fetch a
  piece by a millisecond deadline; libtorrent serves soonest-deadline first.
- btx_add_magnet_ex / btx_add_torrent_file_ex - the plain add path plus
  add-time torrent_flags (set masked bits, default the rest) via a shared
  apply_add_flags helper. The headline use is adding PAUSED so file priorities
  can be set before download starts, or sequential for immediate streaming.

No record-schema change. LCB: kABIVersion -> 8; six foreign decls + bt*
wrappers (btIpFilterAdd/Clear, btSetPieceDeadline, btClearPieceDeadlines,
btAddMagnetEx, btAddTorrentFileEx). 69 -> 75 public handlers.

Built + run under gcc ASan/UBSan against real libtorrent: 549 checks, 0
failures, clean -Wall -Wextra. Static gates green (check-livecodescript 7/7;
record-registry 101 in sync incl. the ABI cross-check now at 8<->8; golden OK).
README + api-reference updated. CI rebuilds the binaries on merge.

This completes the 39 -> 75 handler expansion (ABI v3 -> v8) begun this run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01371AXB4CUUke7enHHS8okc
@SethMorrowSoftware SethMorrowSoftware marked this pull request as ready for review June 27, 2026 04:10
@SethMorrowSoftware SethMorrowSoftware merged commit eb44e5f into main Jun 27, 2026
6 of 7 checks passed
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.

2 participants