cURL / Mailing Lists / curl-users / Single Mail

curl-users

Problems when using the Curl "multi" interface (curl 7.12.0)

From: Henrik Stoerner <henrik_at_hswn.dk>
Date: Tue, 20 Jul 2004 12:15:09 +0200

I am trying to change my Web server monitoring application
from using the simple curl_easy_perform() / one-URL-at-a-time
interface into using curl_multi_perform(), and I've run into
some strange problems.

This is with

"curl 7.12.0 (sparc64-unknown-linux-gnu) libcurl/7.12.0 OpenSSL/0.9.6c
 Protocols: ftp gopher telnet dict ldap http file https ftps
 Features: Largefile NTLM SSL"

It seems to me that the multi-interface is buggy in two respects.

1) When testing many (>120) sites through a single curl_multi
   handle, I get sporadic CURLE_TIMEDOUT (error 28) errors on
   URL's that work perfectly OK.

2) The times reported by curl_get_info's CURLINFO_CONNECT_TIME
   and CURLINFO_TOTAL_TIME are much higher when using the multi
   interface than when testing the same URL's via the simple
   interface.

It also seems that the multi-interface reports a "could not connect"
(error 7) as a "timeout" (error 28), but this is a minor issue.

To try and pin-point the problem, I've isolated the curl code from my
application into a small C program (150 lines) that takes a list of
URL's, creates 2 sets of CURL handles, and then first retrieves all of
the URL's using the simple curl_easy_perform() call, next it puts the
second set of URL's into a curl_multi handle and retrieves them all
once more, this time using the curl_multi_perform() call. It then
prints out a comparison of the results.

The results and the program (and URL list) can be found at
http://www.hswn.dk/~henrik/curl/

If anyone can shed some light on why this fails, I would much
appreciate it.

-- 
Henrik Storner
Received on 2004-07-20