Subject: Re: proper buffer size for libssh2_sftp_read()

Re: proper buffer size for libssh2_sftp_read()

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 15 Jun 2011 13:56:23 +0200 (CEST)

On Wed, 15 Jun 2011, zl liu wrote:

> yes,1.2.8. the test is running on windows 7 .

Ok. We have received bug reports previously on Windows that we haven't been
able to repeat elsewhere and afaik nobody has fixed.

> after i modify the misc.c::445 like : fprintf(stderr, "%s, %d\n", buffer,
> GetLastError()); when -7, the system errno is 10035.

Can you see if you can figure out how that can happen?

10035 is WSAEWOULDBLOCK from what I understand, and src/misc.c:_libssh2_send()
is written so that it converts such an error to return -EAGAIN. The code in
src/transport.c that use _libssh2_send() then checks the return code for
-EAGAIN and should not return anoter error than LIBSSH2_ERROR_EAGAIN (-37) for
that case.

I think we should focus on the first error that happens as I suspect the ones
following may be results of the first problem.

>>> another question , why not define the MACRO :LIBSSH2DEBUG in the debug
>>> mode. when i want to enable traceŁ¬i must define the macro LIBSSH2DEBUG
>>> manually and compile it again.
>>>
>> That's what we have "./configure --enable-debug" for!
>>
> i compile on win32 .it can not execute ./configure.

Ok. But how is defining LIBSSH2DEBUG somewhere not roughly the equivalent?
What can we do to make it even simpler?

-- 
  / daniel.haxx.se

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-06-15