Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 6180:8b6fa4842133
Moved ngx_http_parse_time() to core, renamed accordingly.
The function is now called ngx_parse_http_time(), and can be used by
any code to parse HTTP-style date and time. In particular, it will be
used for OCSP stapling.
For compatibility, a macro to map ngx_http_parse_time() to the new name
provided for a while.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 11 Jun 2015 20:42:31 +0300 |
parents | 74b6ef56ea56 |
children | 0e3a45ec2a3a |
comparison
equal
deleted
inserted
replaced
6179:c61210e2e081 | 6180:8b6fa4842133 |
---|---|
3729 ext.delete_file = 1; | 3729 ext.delete_file = 1; |
3730 ext.log = r->connection->log; | 3730 ext.log = r->connection->log; |
3731 | 3731 |
3732 if (u->headers_in.last_modified) { | 3732 if (u->headers_in.last_modified) { |
3733 | 3733 |
3734 lm = ngx_http_parse_time(u->headers_in.last_modified->value.data, | 3734 lm = ngx_parse_http_time(u->headers_in.last_modified->value.data, |
3735 u->headers_in.last_modified->value.len); | 3735 u->headers_in.last_modified->value.len); |
3736 | 3736 |
3737 if (lm != NGX_ERROR) { | 3737 if (lm != NGX_ERROR) { |
3738 ext.time = lm; | 3738 ext.time = lm; |
3739 ext.fd = tf->file.fd; | 3739 ext.fd = tf->file.fd; |
4126 u->headers_in.last_modified = h; | 4126 u->headers_in.last_modified = h; |
4127 | 4127 |
4128 #if (NGX_HTTP_CACHE) | 4128 #if (NGX_HTTP_CACHE) |
4129 | 4129 |
4130 if (u->cacheable) { | 4130 if (u->cacheable) { |
4131 u->headers_in.last_modified_time = ngx_http_parse_time(h->value.data, | 4131 u->headers_in.last_modified_time = ngx_parse_http_time(h->value.data, |
4132 h->value.len); | 4132 h->value.len); |
4133 } | 4133 } |
4134 | 4134 |
4135 #endif | 4135 #endif |
4136 | 4136 |
4290 | 4290 |
4291 if (r->cache->valid_sec != 0) { | 4291 if (r->cache->valid_sec != 0) { |
4292 return NGX_OK; | 4292 return NGX_OK; |
4293 } | 4293 } |
4294 | 4294 |
4295 expires = ngx_http_parse_time(h->value.data, h->value.len); | 4295 expires = ngx_parse_http_time(h->value.data, h->value.len); |
4296 | 4296 |
4297 if (expires == NGX_ERROR || expires < ngx_time()) { | 4297 if (expires == NGX_ERROR || expires < ngx_time()) { |
4298 u->cacheable = 0; | 4298 u->cacheable = 0; |
4299 return NGX_OK; | 4299 return NGX_OK; |
4300 } | 4300 } |