Skip to content

Keep peer identities consistent across trackers (#59) - #69

Open
elgegeto wants to merge 2 commits into
NikolayIT:masterfrom
elgegeto:fix/issue-59-shared-peer-identity
Open

elgegeto wants to merge 2 commits into
NikolayIT:masterfrom
elgegeto:fix/issue-59-shared-peer-identity

Conversation

@elgegeto

Copy link
Copy Markdown

Closes #59.

When the same info hash is added with two trackers and the same client profile, the automatic identities now share a peer ID, tracker key and port. Timed key rotations are shared too, so the two rows don't drift apart during long runs. Explicit custom identities are left alone.

The TCP listener also validates the handshake at the expected byte offsets rather than searching for the info hash anywhere in the packet. Duplicate registrations have a stable first-match response.

Added tests for two trackers, independent torrents and clients, custom identities, key rotation, and malformed or duplicate handshakes.

I haven't run the .NET 10 test suite locally (SDK unavailable). CI is needed before merging.

…yIT#59)

Keep the first automatic peer id and key for identical info hashes and client profiles, and parse the fixed info-hash field of incoming BitTorrent handshakes. Cover duplicates, independent torrents and explicit custom identities with regression tests.
Use shared identity state for automatically configured rows with the same info hash and client. Rotating the key once keeps their tracker announcements and displayed identity aligned.
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.

The same torrent added with two trackers answers handshakes with the other row's peer id

1 participant