We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
read_line?
1 parent 25b9e48 commit 32717a9Copy full SHA for 32717a9
lib/protocol/http1/connection.rb
@@ -350,7 +350,6 @@ def read(length)
350
# Read a line from the connection.
351
#
352
# @returns [String | Nil] the line read, or nil if the connection is closed.
353
- # @raises [EOFError] if the connection is closed.
354
# @raises [LineLengthError] if the line is too long.
355
def read_line?
356
if line = @stream.gets(CRLF, @maximum_line_length)
@@ -361,6 +360,8 @@ def read_line?
361
360
end
362
363
return line
+ rescue EOFError, Errno::ECONNRESET, Errno::EPIPE
364
+ return nil
365
366
367
0 commit comments