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

Only add new ut_pex peers when we're not seeding #702

Merged
merged 1 commit into from Mar 29, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Only add new ut_pex peers when we're not seeding

Otherwise, we get into a loop of connect, get pex messages, disconnect
because they don't have pieces we need (because we're seeding), try
connecting to the pex peers, etc. etc.
  • Loading branch information
feross committed Mar 28, 2016
commit 8f0d5a7f283567ff636c6690093d8d413d2bd496
@@ -654,6 +654,8 @@ Torrent.prototype._onWire = function (wire, addr) {
wire.use(ut_pex())

wire.ut_pex.on('peer', function (peer) {
// Only add potential new peers when we're not seeding
if (self.done) return
self._debug('ut_pex: got peer: %s (from %s)', peer, addr)
self.addPeer(peer)
})
@@ -669,7 +671,7 @@ Torrent.prototype._onWire = function (wire, addr) {
})
}

// Hook to allow user-defined `bittorrent-protocol extensions
// Hook to allow user-defined `bittorrent-protocol` extensions
// More info: https://github.com/feross/bittorrent-protocol#extension-api
self.emit('wire', wire, addr)

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.