comparison src/http/ngx_http_parse_time.c @ 346:05693816539c NGINX_0_6_17

nginx 0.6.17 *) Feature: the "If-Range" request header line support. Thanks to Alexander V. Inyukhin. *) Bugfix: URL double escaping in a redirect of the "msie_refresh" directive; bug appeared in 0.6.4. *) Bugfix: the "autoindex" directive did not work with the "alias /" directive. *) Bugfix: a segmentation fault might occur in worker process if subrequests were used. *) Bugfix: the big responses may be transferred truncated if SSL and gzip were used. *) Bugfix: the $status variable was equal to 0 if a proxied server returned response in HTTP/0.9 version.
author Igor Sysoev <http://sysoev.ru>
date Thu, 15 Nov 2007 00:00:00 +0300
parents c5c2b2883984
children 6639b93e81b2
comparison
equal deleted inserted replaced
345:4279bc4cdec6 346:05693816539c
9 #include <ngx_types.h> 9 #include <ngx_types.h>
10 10
11 11
12 static int mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 12 static int mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
13 13
14 time_t ngx_http_parse_time(u_char *value, size_t len) 14 time_t
15 ngx_http_parse_time(u_char *value, size_t len)
15 { 16 {
16 u_char *p, *end; 17 u_char *p, *end;
17 int day, month, year, hour, min, sec; 18 int day, month, year, hour, min, sec;
18 enum { 19 enum {
19 no = 0, 20 no = 0,
245 if (--month <= 0) { 246 if (--month <= 0) {
246 month += 12; 247 month += 12;
247 year -= 1; 248 year -= 1;
248 } 249 }
249 250
250 /* Gauss's formula for Grigorian days from 1 March 1 BC */ 251 /* Gauss's formula for Grigorian days from March 1, 1 BC */
251 252
252 return (365 * year + year / 4 - year / 100 + year / 400 253 return (365 * year + year / 4 - year / 100 + year / 400
253 + 367 * month / 12 - 31 254 + 367 * month / 12 - 31
254 + day 255 + day
255 256