From 3aeeefd6e713dc9b6e01fd6c8a8c48ec4bea61f4 Mon Sep 17 00:00:00 2001 From: iamqizhao Date: Tue, 28 Jul 2015 17:00:35 -0700 Subject: [PATCH] small fix --- transport/control.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/transport/control.go b/transport/control.go index 6629ce7b..464bf10a 100644 --- a/transport/control.go +++ b/transport/control.go @@ -104,9 +104,13 @@ type quotaPool struct { // newQuotaPool creates a quotaPool which has quota q available to consume. func newQuotaPool(q int) *quotaPool { - qb := "aPool{c: make(chan int, 1)} + qb := "aPool{ + c: make(chan int, 1), + } if q > 0 { qb.c <- q + } else { + qb.quota = q } return qb }