add some comments
This commit is contained in:
Родитель
1b5f15dda8
Коммит
a1baa00131
|
@ -79,6 +79,7 @@ type http2Client struct {
|
|||
fc *inFlow
|
||||
// sendQuotaPool provides flow control to outbound message.
|
||||
sendQuotaPool *quotaPool
|
||||
// streamsQuota limits the max number of concurrent streams.
|
||||
streamsQuota *quotaPool
|
||||
|
||||
// The scheme used: https if TLS is on, http otherwise.
|
||||
|
@ -248,6 +249,7 @@ func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Strea
|
|||
t.mu.Unlock()
|
||||
return nil, err
|
||||
}
|
||||
// Returns the quota balance back.
|
||||
if q > 1 {
|
||||
t.streamsQuota.add(q-1)
|
||||
}
|
||||
|
|
|
@ -451,14 +451,3 @@ func wait(ctx context.Context, closing <-chan struct{}, proceed <-chan int) (int
|
|||
return i, nil
|
||||
}
|
||||
}
|
||||
|
||||
func wait64(ctx context.Context, closing <-chan struct{}, proceed <-chan int64) (int64, error) {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return 0, ContextErr(ctx.Err())
|
||||
case <-closing:
|
||||
return 0, ErrConnClosing
|
||||
case i := <-proceed:
|
||||
return i, nil
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче