1
  
2
  
3
  
4
  
5
  
6
  
7
  
8
  
9
  
10
  
11
  
12
  
13
  
14
  
15
  
16
  
17
  
18
  
19
  
20
  
21
  
22
  
23
  
24
  
25
  
26
  
27
  
28
  
29
  
30
  
31
  
32
  
33
  
34
  
35
  
36
  
37
  
38
  
39
  
40
  
41
  
42
  
43
  
44
  
// This is a roxen module. Copyright © 1999 - 2000, Roxen IS. 
 
#include <module.h> 
inherit "module"; 
inherit "roxenlib"; 
 
constant thread_safe=1; 
constant cvs_version="$Id: throttletags.pike,v 1.6 2000/04/14 22:22:45 kuntri Exp $"; 
 
#ifdef THROTTLING_DEBUG 
#undef THROTTLING_DEBUG 
#define THROTTLING_DEBUG(X) werror("throttletags: "+X+"\n") 
#else 
#define THROTTLING_DEBUG(X) 
#endif 
 
#define THROW(X) throw( X+"\n" ) 
 
constant module_type = MODULE_PARSER; 
constant module_name = "Throttling control tags"; 
constant module_doc  = "This module provides a <tt>&lt;THROTTLE&gt;</tt> tag " 
  "that you can use to determine a request's allocated bandwidth"; 
 
TAGDOCUMENTATION; 
#ifdef manual 
constant tagdoc=(["throttle":#"<desc tag><short>This tag determines a request's allocated bandwidth.</short></desc> 
 
<attr name=""> 
 
</attr>", 
 
"]); 
#endif 
 
string|int tag_throttle(string tag, mapping args, RequestID id) { 
  mapping t=id->throttle; 
  string tmp; 
  if (t->fixed) { 
    THROTTLING_DEBUG("Fixed. returning"); 
    return 0; 
  } 
  if (args->not) { 
    THROTTLING_DEBUG("Don