From 5cda3affb46bf8c85c1bd19ade8cb1658caf5aaf Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Wed, 16 Jul 2014 17:08:47 +1000 Subject: [PATCH] Memory leak because queued peer requests aren't treated yet --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 4cca686e..2c43af7e 100644 --- a/client.go +++ b/client.go @@ -595,8 +595,8 @@ func (me *Client) connectionLoop(t *torrent, c *connection) error { c.PeerRequests = make(map[request]struct{}, maxRequests) } request := newRequest(msg.Index, msg.Begin, msg.Length) - c.PeerRequests[request] = struct{}{} // TODO: Requests should be satisfied from a dedicated upload routine. + // c.PeerRequests[request] = struct{}{} p := make([]byte, msg.Length) n, err := t.Data.ReadAt(p, int64(t.PieceLength(0))*int64(msg.Index)+int64(msg.Begin)) if err != nil {