Avoid int32 overflow when applying initial window size setting
This commit is contained in:
Родитель
843116533a
Коммит
a8cd0c13a4
|
@ -1166,7 +1166,7 @@ func (t *http2Client) applySettings(ss []http2.Setting) {
|
|||
t.mu.Lock()
|
||||
for _, stream := range t.activeStreams {
|
||||
// Adjust the sending quota for each stream.
|
||||
stream.sendQuotaPool.add(int(s.Val - t.streamSendQuota))
|
||||
stream.sendQuotaPool.add(int(s.Val) - int(t.streamSendQuota))
|
||||
}
|
||||
t.streamSendQuota = s.Val
|
||||
t.mu.Unlock()
|
||||
|
|
|
@ -875,7 +875,7 @@ func (t *http2Server) applySettings(ss []http2.Setting) {
|
|||
t.mu.Lock()
|
||||
defer t.mu.Unlock()
|
||||
for _, stream := range t.activeStreams {
|
||||
stream.sendQuotaPool.add(int(s.Val - t.streamSendQuota))
|
||||
stream.sendQuotaPool.add(int(s.Val) - int(t.streamSendQuota))
|
||||
}
|
||||
t.streamSendQuota = s.Val
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче