shim: IP filter + streaming deadlines + extended add (ABI v8) — roadmap finale#21
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch 5 — the finale of surfacing more of libtorrent. Privacy filtering, streaming, and add-time configuration.
New ABI (v7 → v8, append-only)
btx_*bt*ip_filter_add/ip_filter_clearbtIpFilterAdd/btIpFilterClearset_piece_deadline/clear_piece_deadlinesbtSetPieceDeadline/btClearPieceDeadlinesadd_magnet_ex/add_torrent_file_exbtAddMagnetEx/btAddTorrentFileExtorrent_flags69 → 75 public handlers.
Design notes
get_ip_filter→add_rule→set_ip_filter) so rules accumulate; addresses parsed withlt::make_address(rejects mixed v4/v6 ranges).apply_add_flagshelper — 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.Verification
-Wall -Wextra.check-livecodescript7/7;check-record-registry101 in sync (incl. the ABI cross-check, now confirming 8↔8); golden OK.This completes the expansion
Across this run the binding grew 39 → 75 public handlers, ABI v3 → v8:
Optional follow-ons (not in this PR): DHT
get_peerswith its reply alert,peer_blockedevent surfacing, per-tracker scrape/error detail.🤖 Generated with Claude Code
https://claude.ai/code/session_01371AXB4CUUke7enHHS8okc
Generated by Claude Code