Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packet corrupt problem #40

Open
zhanghp189 opened this issue Aug 30, 2021 · 3 comments
Open

Packet corrupt problem #40

zhanghp189 opened this issue Aug 30, 2021 · 3 comments

Comments

@zhanghp189
Copy link

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)

@norrisjeremy
Copy link

Hi @zhanghp189,

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

Thanks,
Jeremy

@zhanghp189
Copy link
Author

Hi @zhanghp189,

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

Thanks,
Jeremy

the version is 0.1.54

@norrisjeremy
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants