Skip to content

Commit

Permalink
Avoid int32 overflow when applying initial window size setting
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadsherif authored and mehrdada committed Jun 1, 2017
1 parent 8431165 commit a8cd0c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion transport/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion transport/http2_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a8cd0c1

Please sign in to comment.