From: Matt Joiner Date: Sat, 21 Feb 2015 03:54:15 +0000 (+1100) Subject: Limit pending requests to increase responsiveness X-Git-Tag: v1.0.0~1332 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=ea5611d94956e3aa11ebd9ca420a88c04b10f579;p=btrtrc.git Limit pending requests to increase responsiveness --- 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() {