Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/webrick/httpserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ def run(sock)
begin
timeout = @config[:RequestTimeout]
while timeout > 0
# at this point, the client may have already sent data which was
# read by the socket, but openssl may have already buffered it.
# This happens way more in JRuby due to JVM thread scheduling.
break if sock.respond_to?(:pending) && sock.pending > 0

break if sock.to_io.wait_readable(0.5)
break if @status != :Running
timeout -= 0.5
Expand Down
Loading