Changeset c7670f for server/src/http/ngx_http_parse_time.c
- Timestamp:
- 10/30/09 18:13:41 (3 years ago)
- Branches:
- nginx-v0.8
- Parents:
- 178a98
- git-author:
- George Potapov <nephrite@…> (10/30/09 18:13:41)
- git-committer:
- George Potapov <nephrite@…> (10/30/09 18:13:41)
- File:
-
- 1 edited
-
server/src/http/ngx_http_parse_time.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
server/src/http/ngx_http_parse_time.c
r2edd9f rc7670f 9 9 10 10 11 static intmday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };11 static ngx_uint_t mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 12 12 13 13 time_t 14 14 ngx_http_parse_time(u_char *value, size_t len) 15 15 { 16 u_char *p, *end; 17 int day, month, year, hour, min, sec; 16 u_char *p, *end; 17 ngx_int_t month; 18 ngx_uint_t day, year, hour, min, sec; 19 uint64_t time; 18 20 enum { 19 21 no = 0, … … 230 232 } 231 233 232 #if (NGX_TIME_T_SIZE <= 4)233 234 if (year >= 2038) {235 return NGX_ERROR;236 }237 238 #endif239 240 234 /* 241 235 * shift new year to March 1 and start months from 1 (not 0), … … 250 244 /* Gauss' formula for Grigorian days since March 1, 1 BC */ 251 245 252 return(246 time = (uint64_t) ( 253 247 /* days in years including leap years since March 1, 1 BC */ 254 248 … … 269 263 270 264 - 719527 + 31 + 28) * 86400 + hour * 3600 + min * 60 + sec; 265 266 #if (NGX_TIME_T_SIZE <= 4) 267 268 if (time > 0x7fffffff) { 269 return NGX_ERROR; 270 } 271 272 #endif 273 274 return (time_t) time; 271 275 }
Note: See TracChangeset
for help on using the changeset viewer.
