Skip to content

Commit

Permalink
Added log message for early identification termination
Browse files Browse the repository at this point in the history
  • Loading branch information
hierynomus committed Apr 14, 2017
1 parent e36fd0f commit 531eb97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@ private void receiveServerIdent() throws IOException {
final Buffer.PlainBuffer buf = new Buffer.PlainBuffer();
while ((serverID = readIdentification(buf)).isEmpty()) {
int b = connInfo.in.read();
if (b == -1)
if (b == -1) {
log.error("Received end of connection, but no identification received. ");
throw new TransportException("Server closed connection during identification exchange");

}
buf.putByte((byte) b);
}
}
Expand Down

0 comments on commit 531eb97

Please sign in to comment.