Re: questions about multi API
Date: Wed, 08 Jul 2009 07:57:14 -0400
Daniel Stenberg wrote:
> On Tue, 7 Jul 2009, Mohun Biswas wrote:
>> The libcurl-multi doc says things like "libcurl will then transfer
>> data if there is anything available to transfer". Since I'm doing
>> uploads I read this, as I think any native speaker of English would,
>> to mean "if there's anything ready *on the input side*". I'm guessing
>> you really mean "libcurl will then transfer data if any socket is
>> ready". Or maybe even "... if doing so would not cause the program to
>> sleep". Or something - since I don't actually _know_ what it does,
>> it's hard to suggest language.
> Upload is callback based (too). libcurl calls your callback function to
> get data when it already knows that the server socket is ready to
> receive. It doesn't know any file descriptor or similar for reading that
> data when uploading. Your app provides the data when libcurl asks for it.
I still think this would be improved by saying "libcurl will then
transfer any data the handles in the stack are ready to deal with
without blocking". Or something to make clear that curl_multi_perform is
designed not to block. As I understand it avoiding blocking is the
entire point of the multi API, so I can't see any harm in mentioning it
even if you don't want to talk about sockets per se. Currently the only
mention libcurl-multi.3 makes of "blocking" at all is down at the bottom
in the caveats where it lists a few things that may block. But nothing
is said to clarify that outside of these corner conditions, it will not.
This is the central cause of my confusion.
I'll let the other points go as they are either sufficiently explained
now or you've made your beliefs clear. Thanks.
Received on 2009-07-08