cURL / Mailing Lists / curl-library / Single Mail


Re: Re[4]: Working with curl connections as with sockets.

From: Daniel Stenberg <>
Date: Tue, 6 May 2008 00:05:40 +0200 (CEST)

On Mon, 5 May 2008, tetetest tetetest wrote:

> I have checked the usage of Curl_write(), and have come to conclusion that
> if we modify it "to do right", the existing code will break. Currently,
> libcurl does not handle EAGAIN at all - it simply retries to send the data
> until it all goes out or a failure occurs. By the way, this means that on
> slow lines, libcurl can take up lots of CPU time continuously calling send()
> in a cycle (am I right? Or did I miss some waits on the socket?).

Where do you see this happening?

> Handling EAGAIN from Curl_write() will require modifications of the "core"
> libcurl code (e.g., lib/transfer.c around line 1537). Not that I am afraid
> of hacking the sources, but isn't it too much for such a simple feature?
> So for the time being I simply check that Curl_write() returns CURLE_OK with
> zero bytes sent, and assume that it's the symptom of EAGAIN.

Yes, I believe it is and we can leave it like that for now.

> Please find attached the patch (5 existing files modified), 2 man pages
> (going to docs/libcurl), and one example of usage (going to docs/examples).

Ah nice, bonus points for the sample code!

I'll just await Michal Marek's checks on the 'const void *' front first and
see where that leads, then I hope to be able to commit your patch and we can
have some early testing and see how it all behaves!

Thanks for all your work and patience!

  Commercial curl and libcurl Technical Support:
Received on 2008-05-06