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 end
if ready if ready
begin begin
@socket.readpartial(maxlen, buffer) @socket.read(maxlen, buffer)
rescue EOFError rescue EOFError, Errno::ETIMEDOUT
return ConnectionError raise ConnectionError
rescue Errno::ENOTCONN, Errno::EBADF, Errno::ECONNRESET, Errno::EPIPE rescue Errno::ENOTCONN, Errno::EBADF, Errno::ECONNRESET, Errno::EPIPE
raise ConnectionFailure raise ConnectionFailure
rescue Errno::EINTR, Errno::EIO, IOError rescue Errno::EINTR, Errno::EIO, IOError