Project

General

Profile

Bug #1978 ยป max-age.patch

zezo, 2009-05-10 10:11

View differences:

/usr/src/lighttpd-1.4.22/src/mod_expire.c 2009-05-10 12:49:34.000000000 +0300
if (ds->key->used == 0) continue;
if (0 == strncmp(con->uri.path->ptr, ds->key->ptr, ct_len)) {
int ts;
int ts, tc;
time_t t;
size_t len;
stat_cache_entry *sce = NULL;
......
case 0:
/* access */
t = (ts + srv->cur_ts);
tc = ts;
break;
case 1:
/* modification */
t = (ts + sce->st.st_mtime);
tc = t - srv->cur_ts;
break;
default:
/* -1 is handled at parse-time */
......
/* HTTP/1.1 */
buffer_copy_string_len(p->expire_tstmp, CONST_STR_LEN("max-age="));
buffer_append_long(p->expire_tstmp, ts);
buffer_append_long(p->expire_tstmp, tc);
response_header_overwrite(srv, con, CONST_STR_LEN("Cache-Control"), CONST_BUF_LEN(p->expire_tstmp));
    (1-1/1)