This commit is contained in:
Matt Joiner 2015-12-07 02:39:00 +11:00
parent b13444f12e
commit b86253c80d
2 changed files with 7 additions and 1 deletions

1
TODO
View File

@ -7,3 +7,4 @@
* Handle Torrent being dropped before GotInfo.
* Track connection chunk contributions to successful and failed piece hashes. Only drop the worst performer on a bad hash. Maybe block its IP.
* Remove assumptions that the first piece requested will be the first that peers will send.
* Clean-up DHT transaction code, it's just nasty.

View File

@ -36,7 +36,12 @@ func (t *Transaction) tryHandleResponse() {
return
}
select {
case r := <-t.response:
case r, ok := <-t.response:
if !ok {
// TODO: I think some assumption is broken. This isn't supposed to
// happen.
break
}
t.userOnResponse(r)
// Shouldn't be called more than once.
t.userOnResponse = nil