From 61cbb483f249b9ee57259575c0d57e24ceaeefab Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 8 Jan 2014 19:55:24 -0800 Subject: [PATCH] throttle: actually compile. wth did I do? Change-Id: Ia5cb96f3e3b33e254b5a44ddb5ea351f462870e8 --- pkg/throttle/throttle.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/throttle/throttle.go b/pkg/throttle/throttle.go index 6c6d3a44f..5c6972346 100644 --- a/pkg/throttle/throttle.go +++ b/pkg/throttle/throttle.go @@ -128,8 +128,8 @@ func (c *conn) Write(p []byte) (n int, err error) { func (c *conn) Read(p []byte) (n int, err error) { const max = 1024 - if len(p) > sz { - p = p[:sz] + if len(p) > max { + p = p[:max] } n, err = c.Conn.Read(p) time.Sleep(c.Down.byteTime(n))