[nginx] svn commit: r4351 - in branches/stable-1.0: . src/http/modules
mdounin at mdounin.ru
mdounin at mdounin.ru
Tue Dec 13 18:46:07 UTC 2011
Author: mdounin
Date: 2011-12-13 18:46:07 +0000 (Tue, 13 Dec 2011)
New Revision: 4351
Log:
Merge of r4217, r4218:
Fixed "expires @00h". Fixed "expires @time" with unknown last modified
time (ticket #32).
Modified:
branches/stable-1.0/
branches/stable-1.0/src/http/modules/ngx_http_headers_filter_module.c
Property changes on: branches/stable-1.0
___________________________________________________________________
Modified: svn:mergeinfo
- /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4219-4220,4229-4230,4232,4235-4237,4265,4268,4280,4283,4321,4342-4343
+ /trunk:3960-3974,3977-3987,3991-3996,3998,4000-4018,4020,4023,4025-4027,4034-4065,4073,4077,4086-4090,4094-4102,4106-4108,4113-4114,4129-4137,4143-4144,4147-4158,4177,4179,4182-4184,4186-4187,4189-4205,4207,4209-4210,4212,4217-4220,4229-4230,4232,4235-4237,4265,4268,4280,4283,4321,4342-4343
Modified: branches/stable-1.0/src/http/modules/ngx_http_headers_filter_module.c
===================================================================
--- branches/stable-1.0/src/http/modules/ngx_http_headers_filter_module.c 2011-12-13 18:34:34 UTC (rev 4350)
+++ branches/stable-1.0/src/http/modules/ngx_http_headers_filter_module.c 2011-12-13 18:46:07 UTC (rev 4351)
@@ -253,7 +253,7 @@
return NGX_ERROR;
}
- if (conf->expires_time == 0) {
+ if (conf->expires_time == 0 && conf->expires != NGX_HTTP_EXPIRES_DAILY) {
ngx_memcpy(expires->value.data, ngx_cached_http_time.data,
ngx_cached_http_time.len + 1);
ngx_str_set(&cc->value, "max-age=0");
@@ -262,16 +262,16 @@
now = ngx_time();
- if (conf->expires == NGX_HTTP_EXPIRES_ACCESS
- || r->headers_out.last_modified_time == -1)
+ if (conf->expires == NGX_HTTP_EXPIRES_DAILY) {
+ expires_time = ngx_next_time(conf->expires_time);
+ max_age = expires_time - now;
+
+ } else if (conf->expires == NGX_HTTP_EXPIRES_ACCESS
+ || r->headers_out.last_modified_time == -1)
{
expires_time = now + conf->expires_time;
max_age = conf->expires_time;
- } else if (conf->expires == NGX_HTTP_EXPIRES_DAILY) {
- expires_time = ngx_next_time(conf->expires_time);
- max_age = expires_time - now;
-
} else {
expires_time = r->headers_out.last_modified_time + conf->expires_time;
max_age = expires_time - now;
More information about the nginx-devel
mailing list