cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using CURLOPT_TIMECONDITION

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 16 Dec 2003 13:25:34 +0100 (CET)

On Fri, 12 Dec 2003, DOMINICK C MEGLIO wrote:

> > libcurl doesn't help you all the way with this, you need to fetch the
> > HTTP response code and if you got a 304 back, it means that the
> > timecondition didn't evaluate true.
>
> Ok, that doesn't sound too bad. Am I correct in assuming all that means I
> must do is something like:
> curl_easy_perform(curl);
> curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, code);
> if (code == 304)
> do_load_from_cache();
>
> Meaning CURLINFO_RESPONSE_CODE will contain the 304 if it did not meet my
> time condition?

Yeps. That should work.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-16