Преглед изворни кода

pipelimit: enhanced docs for pl_check() function

- documented the algorithm and limit parameters
Daniel-Constantin Mierla пре 11 година
родитељ
комит
24e76b1932
1 измењених фајлова са 12 додато и 1 уклоњено
  1. 12 1
      modules/pipelimit/README

+ 12 - 1
modules/pipelimit/README

@@ -308,7 +308,11 @@ kamcmd cfg.set_now_string pipelimit reply_reason "Limiting"
      * 2 if pipe has NOP algorithm
      * 2 if pipe has NOP algorithm
 
 
    Meaning of the parameters is as follows:
    Meaning of the parameters is as follows:
-     * name - the pseudovariable holding the pipe name.
+     * name - the string or pseudovariable with the pipe name.
+     * algorithm - the string or pseudovariable with the algorithm. The
+       values can be: taildrop, red, network or feedback - see readme of
+       ratelimit module for details on each algorithm.
+     * limit - the integer or pseudovariable with the limit value.
 
 
    This function can be used from REQUEST_ROUTE.
    This function can be used from REQUEST_ROUTE.
 
 
@@ -347,6 +351,13 @@ with unexpected retcode=$var(check_result)\n");
                 exit;
                 exit;
         }
         }
 ...
 ...
+        # perform pipe match for authenticated user
+        $var(limit) = 20;
+        if (!pl_check("$au", "traildrop", "$var(limit)")) {
+                pl_drop();
+                exit;
+        }
+...
 
 
 4.2. pl_drop([ [min ], max ])
 4.2. pl_drop([ [min ], max ])