cURL / Mailing Lists / curl-library / Single Mail

curl-library

one connection to get them all ?

From: <roger21_at_free.fr>
Date: Wed, 20 Jun 2007 08:55:32 +0200

hello

i don't understand why my program still use several connections to retrieve some
files

i use one easy handle, i put the easy perform in a loop and i still got several
connections...

i use a basicaly password protected http connection (set with easy curlopt)
and on my appache access log i got one connection for each file and on my tomcat
session's list i got one session for each file

these are my options

curl_easy_setopt(mycurl, CURLOPT_WRITEFUNCTION, myfunct);
curl_easy_setopt(mycurl, CURLOPT_WRITEDATA, myfile);
curl_easy_setopt(mycurl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(mycurl, CURLOPT_VERBOSE, TRUE);
curl_easy_setopt(mycurl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_easy_setopt(mycurl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt(mycurl, CURLOPT_USERPWD, myuserpassword);
// i had those three next to be sure but with or without it's the same
curl_easy_setopt(mycurl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_easy_setopt(mycurl, CURLOPT_FRESH_CONNECT, 0);
curl_easy_setopt(mycurl, CURLOPT_FORBID_REUSE, 0);

and in the loop

// file management here
curl_easy_setopt(mycurl, CURLOPT_URL, myurl);
curl_easy_perform(mycurl);
curl_easy_getinfo(mycurl, CURLINFO_RESPONSE_CODE, myhttpcode);
// file management here

i get the files correctly but i'd realy want to reduce the number of connections

thanks for any advice

(i know it's a nweebie issue)
Received on 2007-06-20