I did. Feel free to add any comment. Le lundi 21 avril 2014, Matthew DeVore <[email protected]> a écrit :
> Did you already raise one? I saw this: > https://issues.apache.org/jira/browse/SSHD-312 > > > > 2014-04-20 23:25 GMT-07:00 Guillaume Nodet <[email protected]<javascript:;> > >: > > > Sure, that's a good suggestion. Could you please raise a Jira issue ? > > > > Le lundi 21 avril 2014, Matthew DeVore <[email protected] <javascript:;>> > a écrit : > > > > > Aha, my problem was that I was trying to read from stdin before > returning > > > from my Command.start() implementation. If I call new-connection-fn on > a > > > separate thread, it works. > > > > > > Would it be reasonable to either 1) throw an exception if anyone tries > to > > > read/write a stream before returning from start() or 2) allow reading > > from > > > stdin rather than blocking forever? The current behavior is confusing. > > > > > > This is the fix: > > > > > > > > > https://github.com/matvore/hesokuri/commit/5cb13e0a81d7ece6aebdf5c635d150bac1719bf1 > > > > > > > > > 2014-04-20 7:05 GMT-07:00 Matthew DeVore <[email protected]<javascript:;> > <javascript:;> > > > >: > > > > > > > That doesn't appear to be the problem. The spit function creates a > > Writer > > > > around the input stream and then closes it, which should get the > > > underlying > > > > InputStream closed and flushed. > > > > > > > > Just to make sure, I tried this in place of spit: > > > > (.write client-in (int \newline)) > > > > (.flush client-in) > > > > And added a logging call inside the loop in read-line-stream to see > if > > > any > > > > character made it through, but the deadlock still happens at the same > > > spot, > > > > and not even one character makes it through. > > > > > > > > > > > > 2014-04-20 0:43 GMT-07:00 Guillaume Nodet <[email protected]>: > > > > > > > > The getInvertedIn() output stream is buffered. If you want to > > > >> actually send a small amount of data, you need to call flush() after > > > >> writing to the stream. > > > >> > > > >> Happy Easter, > > > >> Guillaume Nodet > > > >> > > > >> > > > >> 2014-04-20 5:15 GMT+02:00 Matthew DeVore <[email protected]>: > > > >> > > > >> > Hi, > > > >> > > > > >> > I'm trying to integrate Apache SSHD with my app and am running > into > > a > > > >> > strange issue. I can establish a connection and open a channel on > a > > > >> > subsystem, and then get the InputStreams and OutputStreams that > > > >> correspond > > > >> > to it. Data transferred over stderr and stdout seem to get > > > transferred, > > > >> but > > > >> > anything written to stdin by the client is not getting to the > > server. > > > >> The > > > >> > client and server are both on localhost and using the SSHD > library. > > > >> > > > > >> > I've written two unit tests to demonstrate this - one that passes > > > >> > (connect-stdout-stderr) and one that deadlocks (connect-stdin). > The > > > >> code is > > > >> > in Clojure. I'd be very grateful if someone could point me in the > > > right > > > >> > direction to fix the failing test. > > > >> > > > > >> > Thank you, > > > >> > Matt > > > >> > > > > >> > *Application code*: > > > >> > > > > >> > > > > >> > > > > > > https://github.com/matvore/hesokuri/blob/4d591abe22a3c24e8756b1316ef763be86b55225/src/hesokuri/ssh.clj > > > >> > *Tests*: > > > >> > > > > >> > > > > >> > > > > > > https://github.com/matvore/hesokuri/blob/4d591abe22a3c24e8756b1316ef763be86b55225/test/hesokuri/test_hesokuri/ssh.clj > > > >> > > > > >> > *Test log output:* > > > >> > 19:41:38:matvore-macbookpro2:~/hesokuri$ lein test :only > > > >> > hesokuri.test-hesokuri.ssh/connect-stdin > > > >> > > > > >> > lein test hesokuri.test-hesokuri.ssh > > > >> > Apr 19, 2014 7:51:41 PM > > > >> > org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration > > run > > > >> > 資訊: Trying to register BouncyCastle as a JCE provider > > > >> > Apr 19, 2014 7:51:42 PM > > > >> > org.apache.sshd.common.util.SecurityUtils$BouncyCastleRegistration > > run > > > >> > 資訊: Registration succeeded > > > >> > Apr 19, 2014 7:51:42 PM > > > org.apache.sshd.client.session.ClientSessionImpl > > > >> > <init> > > > >> > 資訊: Client session created > > > >> > Apr 19, 2014 7:51:42 PM > org.apache.sshd.server.session.ServerSession > > > >> <init> > > > >> > 資訊: Server sessio
