cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Important info about caching

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 15 Feb 2004 14:02:47 +0100 (CET)

On Mon, 9 Feb 2004, codemastr wrote:

> I just have one info regarding CURLINFO_TIMECONDITION. This is rather
> trivial but it seems rather important really. Which should be 1 and which
> should be 0?
>
> Meaning should it be 1 if 304 is returned (or last-mod check fails) or
> should it be 1 otherwise (i.e. complete download)?
>
> It seems using 1 for the latter makes the most sense since we're checking
> whether the time condition was met. E.g. "return it to me if it is newer
> than 1 day old." Then, file is newer than 1 day old == success (1), file is
> older than 1 day == failure (0). However this seems kind of counterintuitive
> to me. What do you think?

I don't mind that very much, just that we make it clear in the documentation.

But I think that if I would use this for the first time, I would assume that
it would return the result of the comparision, just as you say: if the
expression evaluated true, then the info variable returns non-zero. That makes
the variable return 0 in the case you should instead use the cached version.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
Received on 2004-02-15