cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [libssh2] code hangs with sftp downloads, solved

From: Yang Tse <yangsita_at_gmail.com>
Date: Fri, 12 Sep 2008 21:22:04 +0200

2008/9/12, E L <crc1021_at_gmail.com> wrote:

> The libssh2 code is not getting the real socket errors in most cases.
> After calling send() or recv(), it is assuming errno will be set, but
> Windows does not set errno for socket functions. If the connection
> gets reset, the call to send() or recv() will fail, but there is a
> good chance errno will still be set to EAGAIN, so the code will keep
> trying indefinititely.

Yes the real problem is that errno is not being cleared for WIN32 if
the call to recv() or send() succeeds!

> patch is included below to set errno for all send() and recv()

Your patch was real close, but it doesn't address the above statement.

Could you verify if the attached patch works fine for you, and report
back to the list, so that someone might commit it to CVS ?

-- 
-=[Yang]=-

Received on 2008-09-12