jsch
jsch copied to clipboard
Packet corrupt problem
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)
Hi @zhanghp189,
Can you confirm what version of JSch you are encountering this problem with?
Thanks, Jeremy
Hi @zhanghp189,
Can you confirm what version of JSch you are encountering this problem with?
Thanks, Jeremy
the version is 0.1.54
Hi @zhanghp189,
Is this something you are able to easily reproduce? If so, would it be possible to see if it also happens with a newer version of JSch from the fork at https://github.com/mwiede/jsch?
Thanks, Jeremy