Mercurial > hg > nginx
comparison src/http/modules/ngx_http_not_modified_filter.c @ 142:cb77c084acdb
nginx-0.0.1-2003-10-09-11:00:45 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 09 Oct 2003 07:00:45 +0000 |
parents | da00cde00e8a |
children | c71aeb75c071 |
comparison
equal
deleted
inserted
replaced
141:656d468f4ead | 142:cb77c084acdb |
---|---|
37 { | 37 { |
38 time_t ims; | 38 time_t ims; |
39 | 39 |
40 if (r->headers_out.status != NGX_HTTP_OK | 40 if (r->headers_out.status != NGX_HTTP_OK |
41 || r->headers_in.if_modified_since == NULL | 41 || r->headers_in.if_modified_since == NULL |
42 || r->headers_out.last_modified_time == NULL) | 42 || r->headers_out.last_modified_time == -1) |
43 { | 43 { |
44 return next_header_filter(r); | 44 return next_header_filter(r); |
45 } | 45 } |
46 | 46 |
47 ims = ngx_http_parse_time(r->headers_in.if_modified_since->value.data, | 47 ims = ngx_http_parse_time(r->headers_in.if_modified_since->value.data, |
48 r->headers_in.if_modified_since->value.len); | 48 r->headers_in.if_modified_since->value.len); |
49 | 49 |
50 ngx_log_debug(r->connection->log, "%d %d" _ | 50 ngx_log_debug(r->connection->log, "%d %d" _ |
51 ims _ r->headers_out.last_modified_time); | 51 ims _ r->headers_out.last_modified_time); |
52 | 52 |
53 /* I think that the date equality is correcter */ | 53 /* I think that the equality of the dates is correcter */ |
54 | 54 |
55 if (ims != NGX_ERROR && ims == r->headers_out.last_modified_time) { | 55 if (ims != NGX_ERROR && ims == r->headers_out.last_modified_time) { |
56 r->headers_out.status = NGX_HTTP_NOT_MODIFIED; | 56 r->headers_out.status = NGX_HTTP_NOT_MODIFIED; |
57 r->headers_out.content_length = -1; | 57 r->headers_out.content_length = -1; |
58 r->headers_out.content_type->key.len = 0; | 58 r->headers_out.content_type->key.len = 0; |