Ignore:
Timestamp:
10/30/09 18:13:41 (3 years ago)
Author:
George Potapov <nephrite@…>
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)
Message:

Vendor drop nginx v0.8.21

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/src/http/ngx_http_parse_time.c

    r2edd9f rc7670f  
    99 
    1010 
    11 static int mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 
     11static ngx_uint_t mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; 
    1212 
    1313time_t 
    1414ngx_http_parse_time(u_char *value, size_t len) 
    1515{ 
    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; 
    1820    enum { 
    1921        no = 0, 
     
    230232    } 
    231233 
    232 #if (NGX_TIME_T_SIZE <= 4) 
    233  
    234     if (year >= 2038) { 
    235         return NGX_ERROR; 
    236     } 
    237  
    238 #endif 
    239  
    240234    /* 
    241235     * shift new year to March 1 and start months from 1 (not 0), 
     
    250244    /* Gauss' formula for Grigorian days since March 1, 1 BC */ 
    251245 
    252     return ( 
     246    time = (uint64_t) ( 
    253247            /* days in years including leap years since March 1, 1 BC */ 
    254248 
     
    269263 
    270264            - 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; 
    271275} 
Note: See TracChangeset for help on using the changeset viewer.