jsch icon indicating copy to clipboard operation
jsch copied to clipboard

Packet corrupt problem

Open zhanghp189 opened this issue 4 years ago • 3 comments
trafficstars

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)

zhanghp189 avatar Aug 30 '21 09:08 zhanghp189

Hi @zhanghp189,

Can you confirm what version of JSch you are encountering this problem with?

Thanks, Jeremy

norrisjeremy avatar Aug 30 '21 14:08 norrisjeremy

Hi @zhanghp189,

Can you confirm what version of JSch you are encountering this problem with?

Thanks, Jeremy

the version is 0.1.54

zhanghp189 avatar Sep 01 '21 02:09 zhanghp189

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

norrisjeremy avatar Sep 01 '21 12:09 norrisjeremy