Subject: Incomplete read of channel 0 data from remote host.

Incomplete read of channel 0 data from remote host.

From: Ted Lemon <mellon_at_fugue.com>
Date: Fri, 23 Jul 2010 01:08:59 -0400

I'm having a weird problem that I suspect is a failure to understand how the library works, and I'm wondering if somebody can clue me in.

My code is running in non-blocking mode. My app successfully connects to the remote host and authenticates, creates a channel, and starts a shell. Then when I try to read the initial output of the shell, I get nothing--libssh2_channel_read_ex returns EAGAIN.

So I added some code to send "ls\n". Okay, now I get the initial login banner, and part of the ls output, but again it stops before I get a prompt.

It looks like the code is returning EAGAIN when it already has some data, because it wants to fill up my input buffer (256 bytes) before returning any data at all. Does that make sense? Is there a call I'm supposed to do to figure out how much data is available to be read? I couldn't make sense of all the calls for getting and setting windows--is that what I'm missing?

Anyway, thanks in advance for any advice you can give me!

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-07-23