Ted Lemon wrote:
> My buffer for the read was 256 bytes; it looks like it discarded
> everything after that. When I made the buffer 25600 bytes instead
> of 256, I got all the output.
Ok, then please use a larger buffer for now. 1024 should be safe
since it used to be the maximum allowed size for a long time.
> This doesn't explain why I didn't get all the output from the
> initial read, but it's certainly interesting.
Clearly there's some bug in libssh2 when it comes to small buffers,
just like there is with really large buffers. (Never go above ~32500
byte buffers when you send.)
Basically data handling within libssh2 has known problems, and you
bumped into yet another one. If you want to improve libssh2 then your
help with fixing this is very welcome, if not then please stick with
a slightly larger buffer to avoid the problem. :)
//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-07-23