Skip to content

Commit 9aa8dce

Browse files
committed
fix: preventing hang when TCPSocket readable, but no app-data available
1 parent b7c5869 commit 9aa8dce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/net/http.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2495,7 +2495,7 @@ def begin_transport(req)
24952495
debug 'Conn close because of keep_alive_timeout'
24962496
@socket.close
24972497
connect
2498-
elsif @socket.io.to_io.wait_readable(0) && @socket.eof?
2498+
elsif @socket.io.to_io.wait_readable(0) && @socket.io.read_nonblock(1, exception: false) == nil
24992499
debug "Conn close because of EOF"
25002500
@socket.close
25012501
connect

0 commit comments

Comments
 (0)