This commit is contained in:
Kyle Banker 2011-01-17 12:06:03 -05:00
parent 2b835c0e48
commit af43e9c2ce
1 changed files with 2 additions and 1 deletions

View File

@ -750,7 +750,8 @@ module Mongo
# Requires length and an available socket.
def receive_message_on_socket(length, socket)
begin
message = socket.read(length)
message = new_binary_string
socket.read(length, message)
raise ConnectionFailure, "connection closed" unless message.length > 0
if message.length < length
chunk = new_binary_string