Volth created SSHD-579:
--------------------------

             Summary: The last portion of stdout is not received
                 Key: SSHD-579
                 URL: https://issues.apache.org/jira/browse/SSHD-579
             Project: MINA SSHD
          Issue Type: Bug
    Affects Versions: 1.0.0
            Reporter: Volth


Simple client code:
```
      val client = sshd.client.ClientBuilder.builder.build()
      client.start()

      val session = client.connect("root", host, 22).verify().getSession()
      session.addPasswordIdentity(pw)
      session.auth().verify()

      val channel = session.createExecChannel("/bin/bash -c \"/bin/ping -c3 
8.8.8.8\"") // 'bash -c' not needed; it increases % of reproducibility
      channel.setOut(new sshd.common.util.io.NoCloseOutputStream(System.out))
      channel.setErr(new sshd.common.util.io.NoCloseOutputStream(System.err))
      channel.setUsePty(true)
      channel.open().verify()

      
channel.waitFor(sshd.client.channel.ClientChannel.ClientChannelEvent.CLOSED :: 
Nil, 0)
      println("channel.getExitStatus="+channel.getExitStatus)
```
When there is openssh-6.9 on the server (Ubuntu 15.10 default) and setUsePty is 
set to true, the last message with stdout data (SSH_MSG_CHANNEL_DATA) is often 
lost:
http://i.imgur.com/LNdNSRq.png
With setUsePty(false) or with openssh-6.7 on the server everything is fine.

When the last SSH_MSG_CHANNEL_DATA is not lost, it comes after 
SSH_MSG_CHANNEL_REQUEST with "exit-status".
With the OpenSSH client ("ssh -vvv root@server /bin/bash -c '/bin/ping -c3 
8.8.8.8'" also shows this weird ordering) all the messages are always received.

I trued Mins SSHD 1.0.0 and the latest revision from github's master branch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to