]> Sergey Matveev's repositories - btrtrc.git/commitdiff
When seeding, actually seed beyond 6 chunks
authorMatt Joiner <anacrolix@gmail.com>
Wed, 15 Jul 2015 05:29:53 +0000 (15:29 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 15 Jul 2015 05:29:53 +0000 (15:29 +1000)
client.go

index b1d738f0374630f2ca0828adc1f73a2863e6d9bc..586a9034b834db48c6ff85fda885672faea85666 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1410,11 +1410,12 @@ func (me *Client) upload(t *torrent, c *connection) {
        if !c.PeerInterested {
                return
        }
-       if !me.seeding(t) && !t.connHasWantedPieces(c) {
+       seeding := me.seeding(t)
+       if !seeding && !t.connHasWantedPieces(c) {
                return
        }
 another:
-       for c.chunksSent < c.UsefulChunksReceived+6 {
+       for seeding || c.chunksSent < c.UsefulChunksReceived+6 {
                c.Unchoke()
                for r := range c.PeerRequests {
                        err := me.sendChunk(t, c, r)