do not leave the read loop after the epiped event, unless we're out of requests to process or can't read from socket

This commit is contained in:
HoneyryderChuck 2021-02-16 21:37:39 +00:00
parent 3b2d822af9
commit 952ae7c1ef

View File

@ -293,13 +293,14 @@ module HTTPX
# socket has been drained. mark and exit the read loop.
if siz.zero?
read_drained = @read_buffer.empty?
epiped = false
break
end
parser << @read_buffer.to_s
# continue reading if possible.
break if interests == :w
break if interests == :w && !epiped
# exit the read loop if connection is preparing to be closed
break if @state == :closing || @state == :closed