From af43e9c2cee149399e1f00763edfc8ec07eebd52 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Mon, 17 Jan 2011 12:06:03 -0500 Subject: [PATCH] RUBY-255 --- lib/mongo/connection.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mongo/connection.rb b/lib/mongo/connection.rb index 398760a..4992635 100644 --- a/lib/mongo/connection.rb +++ b/lib/mongo/connection.rb @@ -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