~ubuntu-branches/ubuntu/hardy/lighttpd/hardy

« back to all changes in this revision

Viewing changes to src/mod_expire.c

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2007-05-01 13:15:59 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070501131559-y8jos9wp79uf3pp4
Tags: 1.4.15-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - Add fam/gamin stat cache engine support
  - Clean environment in init.d script
  - Replace Depends: on perl with Depends: on libterm-readline-perl-perl
  - Make sure that upgrades succeed, even if we can't restart lighttpd
  - DebianMaintainerField update

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
        /*
86
86
         * parse
87
87
         *
88
 
         * '(access|modification) [plus] {<num> <type>}*'
 
88
         * '(access|now|modification) [plus] {<num> <type>}*'
89
89
         *
90
90
         * e.g. 'access 1 years'
91
91
         */
101
101
        if (0 == strncmp(ts, "access ", 7)) {
102
102
                type  = 0;
103
103
                ts   += 7;
 
104
        } else if (0 == strncmp(ts, "now ", 4)) {
 
105
                type  = 0;
 
106
                ts   += 4;
104
107
        } else if (0 == strncmp(ts, "modification ", 13)) {
105
108
                type  = 1;
106
109
                ts   += 13;
116
119
                ts   += 5;
117
120
        }
118
121
 
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) */
120
123
        while (1) {
121
124
                char *space, *err;
122
125
                int num;
148
151
                        } else if (slen == 6 &&
149
152
                                   0 == strncmp(ts, "months", slen)) {
150
153
                                num *= 60 * 60 * 24 * 30;
 
154
                        } else if (slen == 5 &&
 
155
                                   0 == strncmp(ts, "weeks", slen)) {
 
156
                                num *= 60 * 60 * 24 * 7;
151
157
                        } else if (slen == 4 &&
152
158
                                   0 == strncmp(ts, "days", slen)) {
153
159
                                num *= 60 * 60 * 24;
174
180
                                num *= 60 * 60 * 24 * 30 * 12;
175
181
                        } else if (0 == strcmp(ts, "months")) {
176
182
                                num *= 60 * 60 * 24 * 30;
 
183
                        } else if (0 == strcmp(ts, "weeks")) {
 
184
                                num *= 60 * 60 * 24 * 7;
177
185
                        } else if (0 == strcmp(ts, "days")) {
178
186
                                num *= 60 * 60 * 24;
179
187
                        } else if (0 == strcmp(ts, "hours")) {