Skip to content

Commit

Permalink
DLPX-88615 SSHJ - Bad packet received by server when hearbeat is enab…
Browse files Browse the repository at this point in the history
…led DLPX-88676 SSHJ - Fix false-alarm timeout exception when waiting for key exchange to complete (#10)

PR URL: https://www.github.com/delphix/sshj/pull/10
  • Loading branch information
VenkatanadhanG authored Feb 9, 2024
1 parent dc6b207 commit dcc23c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/net/schmizz/concurrent/Promise.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public void clear() {
lock.lock();
try {
pendingEx = null;
deliver(null);
log.debug("Clearing <<{}>>", name);
val = null;
} finally {
lock.unlock();
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/schmizz/sshj/transport/TransportImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ public long write(SSHPacket payload)
try {

if (kexer.isKexOngoing()) {
// Only transport layer packets (1 to 49) allowed except SERVICE_REQUEST
// Only transport layer packets (1 to 49) allowed except SERVICE_REQUEST and IGNORE
final Message m = Message.fromByte(payload.array()[payload.rpos()]);
if (!m.in(1, 49) || m == Message.SERVICE_REQUEST) {
if (!m.in(1, 49) || m == Message.SERVICE_REQUEST || m == Message.IGNORE) {
assert m != Message.KEXINIT;
kexer.waitForDone();
}
Expand Down

0 comments on commit dcc23c4

Please sign in to comment.