Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
while connecting from one particular server, I am getting this error. While in other server it's running fine.

Following code causes problem:
Java
if(i==buf.buffer.Length ||
i<7 ||                                      // SSH-1.99 or SSH-2.0
(buf.buffer[4]=='1' && buf.buffer[6]!='9')  // SSH-1.5
)
{
throw new JSchException("invalid server's version String ");
}



The below condition becomes true:
Java
i==buf.buffer.Length


Any idea why it's failing on one particular server?
Posted
Updated 30-Mar-12 6:19am
v4
Comments
sundar.s1210 30-Mar-12 11:03am    
value of buf.buffer.Length is 20480
Richard MacCutchan 30-Mar-12 12:20pm    
What are the values of all the variables within this expression?
sundar.s1210 2-Apr-12 0:39am    
buf.buffer.Length = 20480
i = 20480
buf.buffer[4]=255
buf.buffer[6]=255
Fashtas 10-Jul-12 21:32pm    
Did you ever resolve this? We are seeing the exact same thing and the Tamir SSH stuff hasn't been updated since 2007

At a guess this happens approx. 1 out of 5 tries (To *one* server only)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900