Subject: Re: [libssh2] (no subject)

Re: [libssh2] (no subject)

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 10 Sep 2007 14:22:39 -0700

On Mon, Sep 10, 2007 at 12:51:37PM -0400, Paul Thomas wrote:
> On 9/9/07, Paul Thomas <thomaspu_at_gmail.com> wrote:
>
> The problem that I have isn't that I don't know how to read and write stuff
> to my ssh connection, its that after setting up a shell, I don't get
> anything over the socket.
>
> if (libssh2_channel_request_pty(m_channel, "vt100")) {
> log( "Failed requesting pty");
> }
>
> if (libssh2_channel_shell(m_channel)) {
> log( "Unable to request shell on allocated pty");
> }
>
> if ( libssh2_poll_channel_read(m_channel, 0) )
> log("hey, theres data");
>
> libssh2_channel_write(m_channel, "/bin/bash\r\n", strlen("/bin/bash
> \r\n"));
>
> if ( libssh2_poll_channel_read(m_channel, 0) )
> log("hey, theres data");

Sorry, I deleted your code before even looking at it! I suspect what's
happening is that you're not giving the server time to respond.
libssh2_poll_channel_read() returns a value based on what data has already
been received--it doesn't block and wait for it. The polling loop around
the libssh2_channel_read() in my last message gets around that, as would
a call to libssh_poll().

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-09-10