[
https://issues.apache.org/jira/browse/SSHD-720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15702779#comment-15702779
]
Goldstein Lyor commented on SSHD-720:
-------------------------------------
Right off the bat there are several problems with the code - the major one
being that {{handleCommand}} is called from within {{start}} invocation. The
[MINA SSHD
Documentation|https://github.com/apache/mina-sshd/blob/master/README.md]
clearly states:
{quote}
In this context, it is crucial to notice that the command's start() method
implementation must spawn a new thread - even for the simplest or most trivial
command. Any attempt to communicate via the established session will most
likely fail since the packets processing thread may be blocked by this call.
Note: one might get away with executing some command in the context of the
thread that called the start() method, but it is extremely dangerous and should
not be attempted.
{quote}
As I have said, there are other problems with the code - I wish I had time to
go over each line and recommend an improvement. All I can suggest for now is to
(re-)read very carefully the documentation and then look at the test classes
and how they are written in order to see some more examples as to how to write
correct SSH interaction (remember: [god is in the
details|http://www.thequotelab.com/blog/the-origin-of-god-is-in-the-details]).
You may have found a bug, but the sample code does not provide a way to
reproduce it. You are more than welcome to update this issue once you have
found some code that demonstrates the problem - or at least reproduces it with
high probability. It would help if you could *qualify* what the {{not always}}
means - when ? under what circumstances ? - the more details, the better.
> SSHD does not always detect remote closure in time.
> ---------------------------------------------------
>
> Key: SSHD-720
> URL: https://issues.apache.org/jira/browse/SSHD-720
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 1.4.0
> Reporter: Claude Warren
> Priority: Minor
> Attachments: CommsTest2.java
>
>
> I am attempting to use a device that will close the connection if there are
> any invalid commands. The client side does not detect this condition and I
> don't see any way to check for it.
> Example code is attached
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)