Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect the "private" flag in .torrent files #402

Merged
merged 1 commit into from Sep 2, 2015

Conversation

@gillesdemey
Copy link
Contributor

gillesdemey commented Aug 16, 2015

Fixes #271

Couple of caveats:

  • The DHT client still throws the ready event, even though no-one is listening for it. This could be patched in bittorrent-dht to check if the server hasn't been destroyed yet before we emit the event.
  • No tests to check if PEX is correctly disabled.
if (self.parsedTorrent.private && self.client.dht) {
self.client.dht.destroy()
self.client.dht = null
}

This comment has been minimized.

Copy link
@feross

feross Aug 19, 2015

Member

Other torrents might not be private, and we want the DHT to be available to them. Best to solve this a different way that preserves the DHT for use by other torrents.

This comment has been minimized.

Copy link
@gillesdemey

gillesdemey Aug 19, 2015

Author Contributor

Oops, yeah that doesn't seem right.

Then disabling DHT for the discovery and setting DHT to false when passing the handshake options to bittorrent-protocol should suffice?

I'll take another stab at this.

@feross

This comment has been minimized.

Copy link
Member

feross commented Aug 30, 2015

Excellent PR!

Unfortunately, lots of WebTorrent code changed recently as part of efforts to make WebTorrent and torrent-stream/peerflix share more code in common. Would you mind rebasing these changes so they merge cleanly?

@gillesdemey

This comment has been minimized.

Copy link
Contributor Author

gillesdemey commented Aug 30, 2015

I'll take another look, I had noticed that parsedTorrent had been removed.

@feross

This comment has been minimized.

Copy link
Member

feross commented Aug 30, 2015

Right. Instead of doing torrent.parsedTorrent, all those properties now exist directly on the torrent object.

Add test for private torrent - should disable DHT

Fail public torrent test when using a private torrent

standard

Disable DHT for the torrent's swarm and discovery.
@gillesdemey gillesdemey force-pushed the gillesdemey:dev-dht-pex-private branch from cad8f91 to 0babdde Aug 30, 2015
@gillesdemey

This comment has been minimized.

Copy link
Contributor Author

gillesdemey commented Sep 1, 2015

Rebased and updated to reflect the changes in master

feross added a commit that referenced this pull request Sep 2, 2015
Respect the "private" flag in .torrent files
@feross feross merged commit 0a764f1 into webtorrent:master Sep 2, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@feross

This comment has been minimized.

Copy link
Member

feross commented Sep 2, 2015

Nice work! Released as 0.62.0.

I also added you as a GitHub collaborator. Feel free to contribute as you see fit :)

@feross

This comment has been minimized.

Copy link
Member

feross commented Sep 2, 2015

Scratch that, hehe. I already added you from a previous PR 👍

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.