]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Memory leak because queued peer requests aren't treated yet
authorMatt Joiner <anacrolix@gmail.com>
Wed, 16 Jul 2014 07:08:47 +0000 (17:08 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 16 Jul 2014 07:08:47 +0000 (17:08 +1000)
client.go

index 4cca686e1aa12a997b9b8db6e9cb456bc826f262..2c43af7e8e66fe1fa573c2d51a39b9e6215d1764 100644 (file)
--- 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 {