From ea5611d94956e3aa11ebd9ca420a88c04b10f579 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sat, 21 Feb 2015 14:54:15 +1100 Subject: [PATCH] Limit pending requests to increase responsiveness --- download_strategies.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/download_strategies.go b/download_strategies.go index 275b57e3..f3ef027b 100644 --- a/download_strategies.go +++ b/download_strategies.go @@ -40,6 +40,9 @@ func (s *DefaultDownloadStrategy) FillRequests(t *torrent, c *connection) { } } addRequest := func(req request) (again bool) { + if len(c.Requests) >= 32 { + return false + } return c.Request(req) } for e := c.pieceRequestOrder.First(); e != nil; e = e.Next() { -- 2.48.1