Description
Hi,
Session.java
try { buf = read(buf); stimeout = 0; } catch (InterruptedIOException/*SocketTimeoutException*/ ee) { System.out.println("Caught an exception, stimeout:"+ stimeout + " , " + ee.getCause() + ", "+ Arrays.toString(ee.getStackTrace())); JSch.getLogger().log(Logger.INFO, "Caught an exception, " +ee.getMessage() + ", "+ ee.getCause() + ", "+ Arrays.toString(ee.getStackTrace())); if (!in_kex && stimeout < serverAliveCountMax) { sendKeepAliveMsg(); stimeout++; continue; } else if (in_kex && stimeout < serverAliveCountMax) { stimeout++; continue; } throw ee; }
when I set serverAliveInterval=1000 and serverAliveCountMax more than 0,
there is a chance to cause :
Caught an exception, leaving main loop due to com.jcraft.jsch.JSchException: Packet corrupt
I think the reason is when SocketTimeoutException continued, packet size has a chance to excced PACKET_MAX_SIZE(RFC 4253 6.1. Maximum Packet Length, 256*1024)