comparison src/http/modules/ngx_http_headers_filter.c @ 370:54f76b0b8dca

nginx-0.0.7-2004-06-27-22:01:57 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 27 Jun 2004 18:01:57 +0000
parents 2e3cbc1bbe3c
children 537de4dca8ca
comparison
equal deleted inserted replaced
369:9c2515d70489 370:54f76b0b8dca
116 116
117 cc->value.len = sizeof("max-age=0") - 1; 117 cc->value.len = sizeof("max-age=0") - 1;
118 cc->value.data = (u_char *) "max-age=0"; 118 cc->value.data = (u_char *) "max-age=0";
119 119
120 } else { 120 } else {
121 ngx_http_time(expires->value.data, 121 ngx_http_time(expires->value.data, ngx_time() + conf->expires);
122 ngx_cached_time + conf->expires);
123 122
124 if (conf->expires < 0) { 123 if (conf->expires < 0) {
125 cc->value.len = sizeof("no-cache") - 1; 124 cc->value.len = sizeof("no-cache") - 1;
126 cc->value.data = (u_char *) "no-cache"; 125 cc->value.data = (u_char *) "no-cache";
127 126
128 } else { 127 } else {
129 cc->value.data = ngx_palloc(r->pool, NGX_TIME_T_LEN + 1); 128 cc->value.data = ngx_palloc(r->pool, TIME_T_LEN + 1);
130 if (cc->value.data == NULL) { 129 if (cc->value.data == NULL) {
131 return NGX_ERROR; 130 return NGX_ERROR;
132 } 131 }
133 132
134 cc->value.len = ngx_snprintf((char *) cc->value.data, 133 cc->value.len = ngx_snprintf((char *) cc->value.data,
135 sizeof("max-age=") 134 sizeof("max-age=") + TIME_T_LEN,
136 + NGX_TIME_T_LEN, 135 "max-age=" TIME_T_FMT,
137 "max-age=" TIME_T_FMT, 136 conf->expires);
138 conf->expires);
139 } 137 }
140 } 138 }
141 } 139 }
142 } 140 }
143 141