http2: fixed response body buffering, as there was a confusion between chunk and next_chunk

This commit is contained in:
HoneyryderChuck 2017-12-12 21:31:36 +00:00
parent 4fa3b9d1a5
commit db7463d8fb

View File

@ -113,11 +113,11 @@ module HTTPX
while chunk
next_chunk = request.drain_body
stream.data(chunk, end_stream: !next_chunk)
chunk = next_chunk
if chunk && @buffer.full?
@drains[request] = chunk
if next_chunk && @buffer.full?
@drains[request] = next_chunk
throw(:buffer_full)
end
chunk = next_chunk
end
end