commit 5d63f9bbff00993d7834f38cab59e7252776b1c6 Author: delano Date: Wed Jan 13 18:20:41 2010 -0500 Fix related to #recv(1) to #readpartial change in 2.0.16 diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index 38a3608..c0c525e 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -1,3 +1,6 @@ +=== Unreleased + +* Fix related to #recv(1) to #readpartial change in 2.0.16 [Hans de Graaff, Delano Mandelbaum] === 2.0.17 / 14 Dec 2009 @@ -8,7 +11,7 @@ * Fix for "multiple hosts are separated by whitespace" [Akinori MUSHA] * Add support for the ProxyCommand directive [Akinori MUSHA] -* Switched from #recv(1) to #readchar in lib/net/ssh/transport/server_version.rb, so that closed sockets are recognized [Alex Peuchert] +* Switched from #recv(1) to #readpartial in lib/net/ssh/transport/server_version.rb, so that closed sockets are recognized [Alex Peuchert] === 2.0.15 / 03 Sep 2009 diff --git a/lib/net/ssh/test/socket.rb b/lib/net/ssh/test/socket.rb index 4741255..21a20f2 100644 --- a/lib/net/ssh/test/socket.rb +++ b/lib/net/ssh/test/socket.rb @@ -54,6 +54,11 @@ module Net; module SSH; module Test def recv(n) read(n) || "" end + + def readpartial(n) + recv(n) + end + end end; end; end diff --git a/lib/net/ssh/transport/server_version.rb b/lib/net/ssh/transport/server_version.rb index 3a2d7d2..9cdd36c 100644 --- a/lib/net/ssh/transport/server_version.rb +++ b/lib/net/ssh/transport/server_version.rb @@ -43,7 +43,6 @@ module Net; module SSH; module Transport loop do @version = "" loop do -# b = socket.recv(1) begin b = socket.readpartial(1) raise Net::SSH::Disconnect, "connection closed by remote host" if b.nil?