<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -40,18 +40,18 @@ module Net; module SSH; module Transport
       def negotiate!(socket)
         info { &quot;negotiating protocol version&quot; }
 
-        catch :DEAD do
+        loop do
+          @version = &quot;&quot;
           loop do
-            @version = &quot;&quot;
-            loop do
-              b = socket.recv(1)
-              throw :DEAD if b.nil?
-              @version &lt;&lt; b
-              break if b == &quot;\n&quot;
+            b = socket.recv(1)
+            if b.nil?
+              raise Net::SSH::Disconnect, &quot;connection closed by remote host&quot;
             end
-            break if @version.match(/^SSH-/)
-            @header &lt;&lt; @version
+            @version &lt;&lt; b
+            break if b == &quot;\n&quot;
           end
+          break if @version.match(/^SSH-/)
+          @header &lt;&lt; @version
         end
 
         @version.chomp!</diff>
      <filename>lib/net/ssh/transport/server_version.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>70f270bb54fdaa3f33b8ac739db9204f0f71304e</id>
    </parent>
  </parents>
  <author>
    <name>Steven Hazel</name>
    <email>sah@awesame.org</email>
  </author>
  <url>http://github.com/jamis/net-ssh/commit/687584d7616fa71198487ad785f0a24aab0be52a</url>
  <id>687584d7616fa71198487ad785f0a24aab0be52a</id>
  <committed-date>2009-03-07T19:37:41-08:00</committed-date>
  <authored-date>2009-03-07T19:37:41-08:00</authored-date>
  <message>Raise an exception immediately if the remote host disconnects before
sending its version info, rather than letting things go as far as they
can.</message>
  <tree>811f00b27bb87ce41df27dece2db6603bafe7304</tree>
  <committer>
    <name>Steven Hazel</name>
    <email>sah@awesame.org</email>
  </committer>
</commit>
