Mercurial > 510Connectbot
diff src/ch/ethz/ssh2/transport/ClientServerHello.java @ 334:097cfe8770dd ganymed
still hangs during connection
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 31 Jul 2014 14:33:20 -0700 |
parents | 071eccdff8ea |
children | e25e377d29d3 |
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/transport/ClientServerHello.java Thu Jul 31 13:45:59 2014 -0700 +++ b/src/ch/ethz/ssh2/transport/ClientServerHello.java Thu Jul 31 14:33:20 2014 -0700 @@ -42,7 +42,12 @@ bo.write(StringEncoder.GetBytes(String.format("%s\r\n", localIdentifier))); bo.flush(); // Expect SSH-protoversion-softwareversion SP comments CR LF - String remoteIdentifier = new LineNumberReader(new InputStreamReader(bi)).readLine(); + InputStreamReader isr = new InputStreamReader(bi); + LineNumberReader lnr = new LineNumberReader(isr); + String remoteIdentifier = lnr.readLine(); + if (!bi.ready() && lnr.ready()) { + int a= 1; // break + } if (null == remoteIdentifier) { throw new IOException("Premature connection close");