Symptom:
log: Caught an exception, leaving main loop due to SSH_MSG_DISCONNECT: 2
Received ieof for nonexistent channel 1.
Cause:
The channel eof is being sent after the channel has been closed, which
causes the remote end to close the ssh connection completely.
Workaround/fix:
I added some locking to Channel.close() and Channel.eof() to ensure that eof
is not sent after the channel has been closed.
Channel.java:
void close(){
synchronized (this) {
if(close)return;
close=true;
eof_local=eof_remote=true;
}
....
}
void eof(){
synchronized (this) {
if(close)return;
if(eof_local)return;
eof_local=true;
}
....
}
The two threads involved are:
1) User thread calling channel.disconnect()
2) Channel's internal thread calling channel.eof()
-Antony
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users