]> Sergey Matveev's repositories - btrtrc.git/commitdiff
cmd/torrentfs: Expose readahead bytes as a flag
authorMatt Joiner <anacrolix@gmail.com>
Wed, 25 Jun 2014 15:37:00 +0000 (01:37 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 25 Jun 2014 15:37:00 +0000 (01:37 +1000)
cmd/torrentfs/main.go

index 95ff717732bb79f5bda49bb03865b256df3e8d26..3fe50bcd02048578e17253c7818e92459cb6ac46 100644 (file)
@@ -27,6 +27,7 @@ var (
        disableTrackers = flag.Bool("disableTrackers", false, "disables trackers")
        testPeer        = flag.String("testPeer", "", "the address for a test peer")
        pprofAddr       = flag.String("pprofAddr", "", "pprof HTTP server bind address")
+       readaheadBytes  = flag.Int("readaheadBytes", 10*1024*1024, "bytes to readahead in each torrent from the last read piece")
        testPeerAddr    *net.TCPAddr
 )
 
@@ -133,7 +134,7 @@ func main() {
        client := &torrent.Client{
                DataDir:          downloadDir,
                DisableTrackers:  *disableTrackers,
-               DownloadStrategy: &torrent.ResponsiveDownloadStrategy{2 * 1000 * 1024},
+               DownloadStrategy: &torrent.ResponsiveDownloadStrategy{*readaheadBytes},
        }
        client.Start()
        addTorrentDir(client, torrentPath)