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))