Skip to content

Commit

Permalink
torrent loop does not block processing dht results
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Feb 20, 2019
1 parent c33df81 commit a3cd6c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion torrent/dhtannouncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func newDHTAnnouncer(node *node.DHT, infoHash []byte, port int) *dhtAnnouncer {
node: node,
infoHash: string(infoHash),
port: port,
peersC: make(chan []*net.TCPAddr),
peersC: make(chan []*net.TCPAddr, 1),
}
}

Expand Down
1 change: 1 addition & 0 deletions torrent/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ func (s *Session) processDHTResults() {
select {
case t.dhtAnnouncer.peersC <- addrs:
case <-t.removed:
default:
}
}
}
Expand Down

0 comments on commit a3cd6c9

Please sign in to comment.