cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: a question about data transfer lib => app

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 9 Oct 2007 23:00:26 +0200 (CEST)

On Tue, 9 Oct 2007, Gusic Aner-AGU001 wrote:

> Docs for curl_multi_perform say:
> "If you receive CURLM_CALL_MULTI_PERFORM, this basically means that
> you should call curl_multi_perform again, before you select() on
> more actions." And " Do note that curl_multi_perform(3) will return
> CURLM_CALL_MULTI_PERFORM only when it wants to be called again
> immediately."
>
> These two seem a bit contradicting.

They really aren't. The point the docs is trying to make is that you really
MUST NOT wait for more "socket actions" with select() or similar until you
call libcurl again since there are pending actions or data.

> Anyway, how should I do to regulate the data flow (when I have nowhere to
> put the data at the moment)? Should I simply ignore that the return value is
> CURLM_CALL_MULTI_PERFORM or should I do "something" so that the lib returns
> CURLM_OK instead and first then jump out of the loop that is calling
> curl_multi_perform? What is that "something"?

If you can't receive the data yet, then don't call curl_multi_perform() yet.
But if the last return code was CURLM_CALL_MULTI_PERFORM, then you should make
sure to call curl_multi_perform() before you wait for the socket(s) to have
more data for you...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-10-09