Merge pull request #206 from iamqizhao/master
fix a race introduced by pr #205
This commit is contained in:
@ -579,12 +579,13 @@ func (t *http2Client) handleSettings(f *http2.SettingsFrame) {
|
||||
}
|
||||
t.mu.Lock()
|
||||
reset := t.streamsQuota != nil
|
||||
if !reset {
|
||||
t.streamsQuota = newQuotaPool(int(v))
|
||||
}
|
||||
ms := t.maxStreams
|
||||
t.maxStreams = int(v)
|
||||
t.mu.Unlock()
|
||||
if !reset {
|
||||
t.streamsQuota = newQuotaPool(int(v))
|
||||
} else {
|
||||
if reset {
|
||||
t.streamsQuota.reset(int(v) - ms)
|
||||
}
|
||||
case http2.SettingInitialWindowSize:
|
||||
|
Reference in New Issue
Block a user