httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ics.uci.edu>
Subject Re: [PATCH] some cleanups and bug fixes
Date Mon, 04 Aug 1997 01:52:38 GMT
>Ah, cute.  So if I understand what you're saying, then this should work: 
>
>    time_t now;
>
>    /* For all static responses, it's almost certain that the file was
>     * last modified before the beginning of the request.  So there's
>     * no reason to call time(NULL) again.  But for a slow dynamic
>     * content generator that writes a file to cache the results, the
>     * file's modified time can be later than the beginning of the
>     * request.  now is used to ensure we don't issue a Last-Modified
>     * with a date in the future.
>     */
>    if (mtime <= r->request_time) {
>	now = r->request_time;
>    } else {
>	now = time(NULL);
>    }

Yes, I think that would be fine.

     now = (mtime <= r->request_time) ? r->request_time : time(NULL);

would be shorter, but either one is okay with me.  +1

....Roy

Mime
View raw message