Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
0.5.0
-
None
-
None
Description
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)) {}).
Attachments
Issue Links
- duplicates
-
SSHD-145 InvertedShellWrapper may not send process output back if process exits too fast
- Resolved