cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: the return values ofcurl_multi_exec and curl_multi_select

From: Terra Frost <terrafrost_at_gmail.com>
Date: Thu, 27 Jul 2006 21:41:34 -0500

On 7/27/06, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Thu, 27 Jul 2006, Terra Frost wrote:
>
> > I'm trying to better understand the cURL mutli interface and have a few
> > questions.
>
> All these questions and more are probably already at least mostly answered
> in
> the libcurl man pages for the multi interface. I don't however know what
> extra
> logic the PHP glue layer has added, why I won't attempt to answer with
> more
> details.

The question about the return value of curl_multi_perform (which I guess PHP
calls curl_multi_exec) was answered quite nicely here:

http://curl.haxx.se/libcurl/c/curl_multi_perform.html

Their explanation about the second parameter is useful but still leaves me
wondering about why it's not doing what I would have expected it to do (as
elaborated upon in the previous email).

Unfortunately, I didn't see anything about curl_multi_select at any of the
following URLs:

http://curl.haxx.se/libcurl/c/libcurl-multi.html
http://curl.haxx.se/libcurl/c/allfuncs.html

The tutorial (http://curl.haxx.se/libcurl/c/libcurl-tutorial.html), though,
does mention select. My interpretation of that is that curl_multi_select
based on that description is that it blocks until curl_multi_perform has
something to do. But that doesn't explain the return value. Also, the
tutorial mentions curl_multi_fdset - a function for which I can find no PHP
equivalent. Does PHP's curl_multi_exec make this function unnecessary?

Looking at the error codes (
http://curl.haxx.se/libcurl/c/libcurl-errors.html) suggests that -1 is
CURLM_CALL_MULTI_PERFORM
(which is what the PHP sample checks against) but I don't think that means a
whole lot sense if it did, curl_multi_select would also be returning
CURLM_OUT_OF_MEMORY (3), etc. Rather, it seems like maybe the return value
corresponds with the second parameter of curl_multi_exec? This wouldn't
explain the -1, though.

Anyway, if there's a piece of documentation that I didn't consult that you
think I should, let me know. In the mean time, I guess I'll go submit my
quesitons to the curl-library mailing list. Thanks!

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-07-28