Use read instead of readpartial.
Rescue ETIMEDOUT and raise appropriate ConnectionError
This commit is contained in:
Tyler Brock 2012-05-14 15:53:30 -04:00
parent 71650076de
commit 6663660d92
1 changed files with 3 additions and 3 deletions

View File

@ -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