From e91a9a7827892cf835fa0f4df9c60c8bb192e55a Mon Sep 17 00:00:00 2001 From: Martijn Vegter Date: Sat, 21 Oct 2023 12:52:59 +0200 Subject: [PATCH] Reset the sequence numbers on Session disconnect to support reconnection --- src/main/java/com/jcraft/jsch/Session.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/jcraft/jsch/Session.java b/src/main/java/com/jcraft/jsch/Session.java index 97b3d708..92f378ea 100644 --- a/src/main/java/com/jcraft/jsch/Session.java +++ b/src/main/java/com/jcraft/jsch/Session.java @@ -1998,6 +1998,10 @@ public void disconnect() { } io = null; socket = null; + // Reset the incoming/outgoing sequence + seqi = 0; + seqo = 0; + // synchronized(jsch.pool){ // jsch.pool.removeElement(this); // }