From 809aabe53151e5c6cc465e0e6a0cf0572398beac Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 26 Jun 2014 01:37:00 +1000 Subject: [PATCH] cmd/torrentfs: Expose readahead bytes as a flag --- cmd/torrentfs/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/torrentfs/main.go b/cmd/torrentfs/main.go index 95ff7177..3fe50bcd 100644 --- a/cmd/torrentfs/main.go +++ b/cmd/torrentfs/main.go @@ -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) -- 2.48.1