]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Aggressive Upload (#203)
authorSamuel <sam@infitialis.com>
Sun, 5 Nov 2017 03:04:33 +0000 (03:04 +0000)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 5 Nov 2017 03:04:33 +0000 (14:04 +1100)
* Aggressive Upload Config

* Aggressive Upload

* Flip config option.

* Flip Aggressive Upload Config Option

config.go
torrent.go

index 008a0ad0508a06680b9f104811bad2fbc9e39b4f..c0abb23ed908ff1607d44e6136826ec2945e9acd 100644 (file)
--- a/config.go
+++ b/config.go
@@ -27,6 +27,8 @@ type Config struct {
 
        // Never send chunks to peers.
        NoUpload bool `long:"no-upload"`
+       // Disable uploading even when it isn't fair.
+       DisableAggressiveUpload bool `long:"disable-aggressive-upload"`
        // Upload even after there's nothing in it for us. By default uploading is
        // not altruistic, we'll upload slightly more than we download from each
        // peer.
index 3591467f0b9a9456a96d2e24f9cc2f5f1df45a96..0e4d00214b1446c56440fbeadf1021110b9efd45 100644 (file)
@@ -1176,7 +1176,7 @@ func (t *Torrent) seeding() bool {
        if !cl.config.Seed {
                return false
        }
-       if t.needData() {
+       if cl.config.DisableAggressiveUpload && t.needData() {
                return false
        }
        return true