RUBY-433 fixes IOError stream closed

This commit is contained in:
Tyler Brock 2012-04-05 10:52:13 -04:00
parent a5b5d5e3e3
commit 4f9aceacf4
1 changed files with 3 additions and 1 deletions

View File

@ -217,7 +217,9 @@ module Mongo
if @pids[socket] != Process.pid if @pids[socket] != Process.pid
@pids[socket] = nil @pids[socket] = nil
@sockets.delete(socket) @sockets.delete(socket)
socket.close if socket if socket
socket.close unless socket.closed?
end
checkout_new_socket checkout_new_socket
else else
@checked_out << socket @checked_out << socket