diff options
author | Arno Töll <arno@debian.org> | 2012-11-21 23:03:46 +0100 |
---|---|---|
committer | Arno Töll <arno@debian.org> | 2012-11-21 23:03:46 +0100 |
commit | 0f22664a8c9f92c8b7d5dd05772bacf7caecbd52 (patch) | |
tree | c85da4e4968e5ec69d6d154fa032672f45cb3e13 /src/mod_expire.c | |
parent | 9fa7c3d770fb8688555b661940e04c3bf6b6d8aa (diff) | |
download | lighttpd-0f22664a8c9f92c8b7d5dd05772bacf7caecbd52.tar.gz |
Imported Upstream version 1.4.15upstream/1.4.15
Diffstat (limited to 'src/mod_expire.c')
-rw-r--r-- | src/mod_expire.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mod_expire.c b/src/mod_expire.c index 037e21a..b58b97d 100644 --- a/src/mod_expire.c +++ b/src/mod_expire.c @@ -85,7 +85,7 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, in /* * parse * - * '(access|modification) [plus] {<num> <type>}*' + * '(access|now|modification) [plus] {<num> <type>}*' * * e.g. 'access 1 years' */ @@ -101,6 +101,9 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, in if (0 == strncmp(ts, "access ", 7)) { type = 0; ts += 7; + } else if (0 == strncmp(ts, "now ", 4)) { + type = 0; + ts += 4; } else if (0 == strncmp(ts, "modification ", 13)) { type = 1; ts += 13; @@ -116,7 +119,7 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, in ts += 5; } - /* the rest is just <number> (years|months|days|hours|minutes|seconds) */ + /* the rest is just <number> (years|months|weeks|days|hours|minutes|seconds) */ while (1) { char *space, *err; int num; @@ -148,6 +151,9 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, in } else if (slen == 6 && 0 == strncmp(ts, "months", slen)) { num *= 60 * 60 * 24 * 30; + } else if (slen == 5 && + 0 == strncmp(ts, "weeks", slen)) { + num *= 60 * 60 * 24 * 7; } else if (slen == 4 && 0 == strncmp(ts, "days", slen)) { num *= 60 * 60 * 24; @@ -174,6 +180,8 @@ static int mod_expire_get_offset(server *srv, plugin_data *p, buffer *expire, in num *= 60 * 60 * 24 * 30 * 12; } else if (0 == strcmp(ts, "months")) { num *= 60 * 60 * 24 * 30; + } else if (0 == strcmp(ts, "weeks")) { + num *= 60 * 60 * 24 * 7; } else if (0 == strcmp(ts, "days")) { num *= 60 * 60 * 24; } else if (0 == strcmp(ts, "hours")) { |