From e08d11a4b9a776af206da495d67a989bd4ae196f Mon Sep 17 00:00:00 2001
From: Matt Joiner <anacrolix@gmail.com>
Date: Sun, 28 Jan 2018 15:42:37 +1100
Subject: [PATCH] Update Client.newConnection with changed rateLimitedReader
 interface

---
 client.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/client.go b/client.go
index ab2fe08d..95d348f8 100644
--- a/client.go
+++ b/client.go
@@ -1250,7 +1250,10 @@ func (cl *Client) newConnection(nc net.Conn) (c *connection) {
 	}
 	c.writerCond.L = &cl.mu
 	c.setRW(connStatsReadWriter{nc, &cl.mu, c})
-	c.r = rateLimitedReader{cl.downloadLimit, c.r}
+	c.r = &rateLimitedReader{
+		l: cl.downloadLimit,
+		r: c.r,
+	}
 	return
 }
 
-- 
2.51.0