]> granicus.if.org Git - apache/commitdiff
allow <= and >= for filter dispatcher
authorAndré Malo <nd@apache.org>
Sun, 17 Oct 2004 18:31:44 +0000 (18:31 +0000)
committerAndré Malo <nd@apache.org>
Sun, 17 Oct 2004 18:31:44 +0000 (18:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105507 13f79535-47bb-0310-9956-ffa450edef68

include/util_filter.h
modules/experimental/mod_filter.c

index 7d422369e282ba9b214dcb1f214af2d1f0b74795..d400208e85f84a6517b583f4ca8bf4f3f140f5f3 100644 (file)
@@ -275,7 +275,9 @@ struct ap_filter_provider_t {
         REGEX_MATCH,
         INT_EQ,
         INT_LT,
+        INT_LE,
         INT_GT,
+        INT_GE,
         DEFINED
     } match_type;
 
index 13192b2a79da93e468557b4d51c36c624ace7ff6..8d52492352b51ffea895a1e4452ea5b6a6efcd35 100644 (file)
@@ -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 '=':