func (qb *quotaPool) add(v int) {
	qb.mu.Lock()
	defer qb.mu.Unlock()
	select {
	case n := <-qb.c:
		qb.quota += n
	default:
	}
	qb.quota += v
	if qb.quota <= 0 {
		return
	}
	select {
	case qb.c <- qb.quota:
		qb.quota = 0
	default:
	}
}
add cancels the pending quota sent on acquired, incremented by v and sends
it back on acquire.
package transport
import (
	"fmt"
	"math"
	"sync"
	"time"
	"golang.org/x/net/http2"
)
const (
	defaultWindowSize = 65535
	initialWindowSize             = defaultWindowSize  
	infinity                      = time.Duration(math.MaxInt64)
	defaultClientKeepaliveTime    = infinity
	defaultClientKeepaliveTimeout = time.Duration(20 * time.Second)
	defaultMaxStreamsClient       = 100
	defaultMaxConnectionIdle      = infinity
	defaultMaxConnectionAge       = infinity
	defaultMaxConnectionAgeGrace  = infinity
	defaultServerKeepaliveTime    = time.Duration(2 * time.Hour)
	defaultServerKeepaliveTimeout = time.Duration(20 * time.Second)
	defaultKeepalivePolicyMinTime = time.Duration(5 * time.Minute)
	maxWindowSize = math.MaxInt32
)
type windowUpdate struct {
	streamID  uint32
	increment uint32
	flush     bool
}
func (*windowUpdate) item() {}
type settings struct {
	ack bool
	ss  []http2.Setting
}
func (*settings) item() {}
type resetStream struct {
	streamID uint32
	code     http2.ErrCode
}
func (*resetStream) item() {}
type goAway struct {
	code      http2.ErrCode
	debugData []byte
}
func (*goAway) item() {}
type flushIO struct {
}
func (*flushIO) item() {}
type ping struct {
	ack  bool
	data [8]byte
}
func (*ping) item() {}
type quotaPool struct {
	c chan int
	mu    sync.Mutex
	quota int
}
func newQuotaPool(q int) *quotaPool {
	qb := &quotaPool{
		c: make(chan int, 1),
	}
	if q > 0 {
		qb.c <- q
	} else {
		qb.quota = q
	}
	return qb
}