comparison src/ch/ethz/ssh2/transport/ClientServerHello.java @ 338:126af684034e ganymed

still hangs during connection
author Carl Byington <carl@five-ten-sg.com>
date Thu, 31 Jul 2014 15:03:49 -0700
parents 0d0d2fc9918c
children
comparison
equal deleted inserted replaced
337:0d0d2fc9918c 338:126af684034e
74 String localIdentifier = String.format("SSH-2.0-%s", softwareversion); 74 String localIdentifier = String.format("SSH-2.0-%s", softwareversion);
75 bo.write(StringEncoder.GetBytes(String.format("%s\r\n", localIdentifier))); 75 bo.write(StringEncoder.GetBytes(String.format("%s\r\n", localIdentifier)));
76 bo.flush(); 76 bo.flush();
77 // Expect SSH-protoversion-softwareversion SP comments CR LF 77 // Expect SSH-protoversion-softwareversion SP comments CR LF
78 byte[] serverVersion = new byte[512]; 78 byte[] serverVersion = new byte[512];
79 String remoteIdentifier; 79 String remoteIdentifier = null;
80 for (int i = 0; i < 50; i++) { 80 for (int i = 0; i < 50; i++) {
81 int len = readLineRN(bi, serverVersion); 81 int len = readLineRN(bi, serverVersion);
82 remoteIdentifier = new String(serverVersion, 0, len, "ISO-8859-1"); 82 remoteIdentifier = new String(serverVersion, 0, len, "ISO-8859-1");
83 if (remoteIdentifier.startsWith("SSH-")) break; 83 if (remoteIdentifier.startsWith("SSH-")) break;
84 } 84 }