cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl how to get size of data downloaded?

From: rohan <rohan_at_magma.ca>
Date: Wed, 12 May 2004 17:15:45 -0400 (EDT)

I have written a c file to browse a list of sites every hour and log the time taken to
access the sites and the size of the page/image/etc downloaded.
MY question is how do i get the size of the data downloaded fr om the curl functions. Is
there any such function?
ex:(segment of code)
           
           curl_easy_setopt(curl, CURLOPT_URL, urls[i]);
           curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT,10);
           curl_easy_setopt(curl, CURLOPT_TIMEOUT,timeout);
           curl_easy_setopt(curl, CURLOPT_FILE,filen);
           gettimeofday(&begin_time,0);
           res = curl_easy_perform(curl);
           gettimeofday(&end_time,0);
           difftimeval(&end_time,&begin_time,&time_diff);
           size = ???? <----- how do i get the size here?
Thanks
Rohan
Received on 2004-05-13