Repository navigation
Handle unsupported "paused" announces without closing the WebSocket - #1
Closed
jasminsehic wants to merge 1 commit into
Closed
jasminsehic wants to merge 1 commit into
jasminsehic wants to merge 1 commit into
Conversation
Member
|
Thanks for the report and the detailed references — they were very helpful. We fixed this on wt-tracker: Novage/wt-tracker@5fdad75 · wt-tracker-rust: 334badd. Closing this in favour of those commits. |
Author
|
Nice one, thank you |
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.
Summary
Handle WebTorrent
event: "paused"messages as an explicit unsupported-event response instead of a protocol parse error that closes the WebSocket.The Rust parser currently treats
pausedas an unknown event. The server's protocol-error path closes the connection (code 1008) and disconnects its peers. This change returns an announce failure response while keeping the connection open and leaving tracker membership unchanged. Other unsupported announce events retain their existing behavior.Why
The
pausedannounce event has an established history in the BitTorrent ecosystem and is sent by WebTorrent-capable clients.event=pausedfor partial seeds. BEP 21paused, to WebSocket JSON messages.pausedclient event. The reference implementation treats it as an update, falling back to a start if the peer is not already in the swarm.pausedwithout closing the connection.This change is intentionally limited to connection-safe handling of
paused. It does not implement BEP 21 partial-seed tracking or change swarm membership; the tracker returns an explicit unsupported-event response and preserves the connection.Implementation
pausedbefore normal announce-field validation, so missing or invalid announce fields do not turn it into a protocol error.{"action":"announce","failure reason":"unsupported announce event: paused"}.info_hashonly when the original JSON value is a string, preserving its raw token for the response; omit it when missing or non-string.OwnedMessageand count the response separately asannounce_error.pausedis the first message.docs/SPEC.mdandCHANGELOG.md.Tests
paused, escaped event spelling, missing/non-stringinfo_hash, and invalidpeer_id.info_hash, response counters, and no tracker-state mutation.