Changeset 1478

Show
Ignore:
Timestamp:
12/19/2006 03:11:04 PM (20 months ago)
Author:
glen
Message:

added now and weeks support to mod_expire. close #943

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/src/mod_expire.c

    r1371 r1478  
    8686         * parse 
    8787         * 
    88          * '(access|modification) [plus] {<num> <type>}*' 
     88         * '(access|now|modification) [plus] {<num> <type>}*' 
    8989         * 
    9090         * e.g. 'access 1 years' 
     
    102102                type  = 0; 
    103103                ts   += 7; 
     104        } else if (0 == strncmp(ts, "now ", 4)) { 
     105                type  = 0; 
     106                ts   += 4; 
    104107        } else if (0 == strncmp(ts, "modification ", 13)) { 
    105108                type  = 1; 
     
    117120        } 
    118121 
    119         /* the rest is just <number> (years|months|days|hours|minutes|seconds) */ 
     122        /* the rest is just <number> (years|months|weeks|days|hours|minutes|seconds) */ 
    120123        while (1) { 
    121124                char *space, *err; 
     
    149152                                   0 == strncmp(ts, "months", slen)) { 
    150153                                num *= 60 * 60 * 24 * 30; 
     154                        } else if (slen == 5 && 
     155                                   0 == strncmp(ts, "weeks", slen)) { 
     156                                num *= 60 * 60 * 24 * 7; 
    151157                        } else if (slen == 4 && 
    152158                                   0 == strncmp(ts, "days", slen)) { 
     
    175181                        } else if (0 == strcmp(ts, "months")) { 
    176182                                num *= 60 * 60 * 24 * 30; 
     183                        } else if (0 == strcmp(ts, "weeks")) { 
     184                                num *= 60 * 60 * 24 * 7; 
    177185                        } else if (0 == strcmp(ts, "days")) { 
    178186                                num *= 60 * 60 * 24;