RUBY-442
Use read instead of readpartial. Rescue ETIMEDOUT and raise appropriate ConnectionError
This commit is contained in:
parent
71650076de
commit
6663660d92
@ -69,9 +69,9 @@ module Mongo
|
||||
end
|
||||
if ready
|
||||
begin
|
||||
@socket.readpartial(maxlen, buffer)
|
||||
rescue EOFError
|
||||
return ConnectionError
|
||||
@socket.read(maxlen, buffer)
|
||||
rescue EOFError, Errno::ETIMEDOUT
|
||||
raise ConnectionError
|
||||
rescue Errno::ENOTCONN, Errno::EBADF, Errno::ECONNRESET, Errno::EPIPE
|
||||
raise ConnectionFailure
|
||||
rescue Errno::EINTR, Errno::EIO, IOError
|
||||
|
Loading…
Reference in New Issue
Block a user