Merge pull request #206 from iamqizhao/master

fix a race introduced by pr #205
This commit is contained in:
Qi Zhao
2015-06-01 13:13:34 -07:00

View File

@ -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: