lib/async/http/protocol/http1/connection.rb in async-http-0.56.2 vs lib/async/http/protocol/http1/connection.rb in async-http-0.56.3
- old
+ new
@@ -31,10 +31,11 @@
module HTTP1
class Connection < ::Protocol::HTTP1::Connection
def initialize(stream, version)
super(stream)
+ @ready = true
@version = version
end
attr :version
@@ -46,12 +47,10 @@
false
end
def read_line?
@stream.read_until(CRLF)
- rescue Errno::ECONNRESET
- return nil
end
def read_line
@stream.read_until(CRLF) or raise EOFError, "Could not read line!"
end
@@ -66,14 +65,14 @@
1
end
# Can we use this connection to make requests?
def viable?
- @stream&.connected?
+ @ready && @stream&.connected?
end
def reusable?
- @persistent && @stream && !@stream.closed?
+ @ready && @persistent && @stream && !@stream.closed?
end
end
end
end
end