ASF Bugzilla – Attachment 22444 Details for
Bug 41391
too long period setting makes max-age overflow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
do not allow negetive value in max-age
patch (text/plain), 1.11 KB, created by
rahul
on 2008-08-13 14:08:35 UTC
(
hide
)
Description:
do not allow negetive value in max-age
Filename:
MIME Type:
Creator:
rahul
Created:
2008-08-13 14:08:35 UTC
Size:
1.11 KB
patch
obsolete
>Index: modules/metadata/mod_expires.c >=================================================================== >--- modules/metadata/mod_expires.c (revision 685653) >+++ modules/metadata/mod_expires.c (working copy) >@@ -397,6 +397,7 @@ > apr_time_t base; > apr_time_t additional; > apr_time_t expires; >+ apr_time_t e; > int additional_sec; > char *timestr; > >@@ -428,11 +429,15 @@ > "internal error: bad expires code: %s", r->filename); > return HTTP_INTERNAL_SERVER_ERROR; > } >- >+ /* Do not let max-age be negetive. >+ */ >+ e = apr_time_sec(base - r->request_time) + apr_time_sec(additional); >+ if (e < 0) e = APR_INT64_MAX; > expires = base + additional; >+ if (expires < 0) expires = APR_INT64_MAX; > apr_table_mergen(t, "Cache-Control", > apr_psprintf(r->pool, "max-age=%" APR_TIME_T_FMT, >- apr_time_sec(expires - r->request_time))); >+ e)); > timestr = apr_palloc(r->pool, APR_RFC822_DATE_LEN); > apr_rfc822_date(timestr, expires); > apr_table_setn(t, "Expires", timestr);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41391
:
22444
|
22445