cURL / Mailing Lists / curl-library / Single Mail


Re: multithreads or multi interface

From: Daniel Stenberg <>
Date: Wed, 7 Sep 2005 00:15:35 +0200 (CEST)

On Tue, 6 Sep 2005, Martin Vogt wrote:

> Have you compiled the program, I think it show the problem very clearly on
> any www site.
> (Although it might still be a bug in how I use libcurl.)

I noticed two mistakes, but rather minor ones:

curl_multi_add_handle() will never return CURLM_CALL_MULTI_PERFORM. You need
to call curl_multi_perform() to make libcurl actually do anything with the
handle you've just added.

You are unconditionally always call curl_multi_perform() twice within your
main loop. That is not gonna be efficiant if the second call is made when no
new handles were added since then there's not likely to be any action to get

If you fix that and turn this into a nice and clean C program, I'll try to get
some time off and run some tests with it to see if I can figure out anything.

Is your test server running on localhost or on a LAN/WAN?

  Commercial curl and libcurl Technical Support:
Received on 2005-09-07