ngx_table_elt_t *h, ngx_uint_t offset);
static ngx_int_t ngx_http_upstream_process_content_length(ngx_http_request_t *r,
ngx_table_elt_t *h, ngx_uint_t offset);
+static ngx_int_t ngx_http_upstream_process_last_modified(ngx_http_request_t *r,
+ ngx_table_elt_t *h, ngx_uint_t offset);
static ngx_int_t ngx_http_upstream_process_set_cookie(ngx_http_request_t *r,
ngx_table_elt_t *h, ngx_uint_t offset);
static ngx_int_t
offsetof(ngx_http_headers_out_t, date), 0 },
{ ngx_string("Last-Modified"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, last_modified),
+ ngx_http_upstream_process_last_modified, 0,
ngx_http_upstream_copy_last_modified, 0, 0 },
{ ngx_string("ETag"),
}
if (valid) {
- r->cache->last_modified = r->headers_out.last_modified_time;
+ r->cache->last_modified = u->headers_in.last_modified_time;
r->cache->date = now;
r->cache->body_start = (u_short) (u->buffer.pos - u->buffer.start);
}
+static ngx_int_t
+ngx_http_upstream_process_last_modified(ngx_http_request_t *r,
+ ngx_table_elt_t *h, ngx_uint_t offset)
+{
+ ngx_http_upstream_t *u;
+
+ u = r->upstream;
+
+ u->headers_in.last_modified = h;
+
+#if (NGX_HTTP_CACHE)
+
+ if (u->cacheable) {
+ u->headers_in.last_modified_time = ngx_http_parse_time(h->value.data,
+ h->value.len);
+ }
+
+#endif
+
+ return NGX_OK;
+}
+
+
static ngx_int_t
ngx_http_upstream_process_set_cookie(ngx_http_request_t *r, ngx_table_elt_t *h,
ngx_uint_t offset)
#if (NGX_HTTP_CACHE)
if (r->upstream->cacheable) {
- r->headers_out.last_modified_time = ngx_http_parse_time(h->value.data,
- h->value.len);
+ r->headers_out.last_modified_time =
+ r->upstream->headers_in.last_modified_time;
}
#endif