Skip to content

Commit

Permalink
Spdy2: Fix Infinite loop when write data of big size
Browse files Browse the repository at this point in the history
The Write() of ResponseStream does not chunk the response correctly, and cause infinite loop when data size is greater than common.MAX_DATA_SIZE
  • Loading branch information
iyangsj committed Oct 24, 2015
1 parent bb9a1f4 commit 01d99a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spdy2/response_stream.go
Expand Up @@ -103,7 +103,8 @@ func (s *ResponseStream) Write(inputData []byte) (int, error) {
dataFrame.StreamID = s.streamID
dataFrame.Data = data[:common.MAX_DATA_SIZE]
s.output <- dataFrame


data = data[common.MAX_DATA_SIZE:]
written += common.MAX_DATA_SIZE
}

Expand Down

0 comments on commit 01d99a3

Please sign in to comment.