summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Malo <nd@apache.org>2004-10-17 20:31:44 +0200
committerAndré Malo <nd@apache.org>2004-10-17 20:31:44 +0200
commita9a11aab672f383ce0b8068a4290aedc3705957c (patch)
tree25826dfd22c201948a06e48335779ead3001070a
parentminor optimizations (diff)
downloadapache2-a9a11aab672f383ce0b8068a4290aedc3705957c.tar.xz
apache2-a9a11aab672f383ce0b8068a4290aedc3705957c.zip
allow <= and >= for filter dispatcher
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105507 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/util_filter.h2
-rw-r--r--modules/experimental/mod_filter.c26
2 files changed, 26 insertions, 2 deletions
diff --git a/include/util_filter.h b/include/util_filter.h
index 7d422369e2..d400208e85 100644
--- a/include/util_filter.h
+++ b/include/util_filter.h
@@ -275,7 +275,9 @@ struct ap_filter_provider_t {
REGEX_MATCH,
INT_EQ,
INT_LT,
+ INT_LE,
INT_GT,
+ INT_GE,
DEFINED
} match_type;
diff --git a/modules/experimental/mod_filter.c b/modules/experimental/mod_filter.c
index 13192b2a79..8d52492352 100644
--- a/modules/experimental/mod_filter.c
+++ b/modules/experimental/mod_filter.c
@@ -170,11 +170,21 @@ static ap_out_filter_func filter_lookup(request_rec *r, ap_filter_rec_t *filter)
match = 0;
}
break;
+ case INT_LE:
+ if (atoi(str) <= provider->match.number) {
+ match = 0;
+ }
+ break;
case INT_GT:
if (atoi(str) > provider->match.number) {
match = 0;
}
break;
+ case INT_GE:
+ if (atoi(str) >= provider->match.number) {
+ match = 0;
+ }
+ break;
case DEFINED: /* we already handled this:-) */
break;
}
@@ -486,11 +496,23 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, const char *fname,
switch (*match++) {
case '<':
- provider->match_type = INT_LT;
+ if (*match == '=') {
+ provider->match_type = INT_LE;
+ ++match;
+ }
+ else {
+ provider->match_type = INT_LT;
+ }
provider->match.number = atoi(match);
break;
case '>':
- provider->match_type = INT_GT;
+ if (*match == '=') {
+ provider->match_type = INT_GE;
+ ++match;
+ }
+ else {
+ provider->match_type = INT_GT;
+ }
provider->match.number = atoi(match);
break;
case '=':