[ 
https://issues.apache.org/jira/browse/SSHD-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13122429#comment-13122429
 ] 

Tim Vernum commented on SSHD-125:
---------------------------------

Patch available at SSHD-145
                
> InvertedShellWrapper won't pump end of stream
> ---------------------------------------------
>
>                 Key: SSHD-125
>                 URL: https://issues.apache.org/jira/browse/SSHD-125
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 0.5.0
>            Reporter: René Treffer
>
> The "pumpStreams" method ( 
> http://svn.apache.org/viewvc/mina/sshd/trunk/sshd-core/src/main/java/org/apache/sshd/server/shell/InvertedShellWrapper.java#l89
>  ) of InvertedShellWrapper has a loop that won't collect the last output of a 
> process.
> The faulty event sequence looks like this:
> 1. process alive? -> yes
> 2. Anything to pump? -> no
> 3. Thread.sleep(1)
> 4. process alive? -> no
> 5. call exit handler and end pump thread
> This will obviously discard any output of the process during step 3 and 4.
> The solution would be to pump all pending output before the exit handler gets 
> called (while (pumpStream(shellOut, out, buffer) || pumpStream(shellErr, err, 
> buffer)) {}).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to