9284272000-03-17Martin Nilsson // This is a roxen module. Copyright © 1999 - 2000, Roxen IS.
e658201999-09-29Francesco Chemolli #include <module.h> inherit "module"; inherit "roxenlib"; constant thread_safe=1;
725ce62000-04-15Kenneth Johansson constant cvs_version="$Id: throttletags.pike,v 1.6 2000/04/14 22:22:45 kuntri Exp $";
e658201999-09-29Francesco Chemolli  #ifdef THROTTLING_DEBUG #undef THROTTLING_DEBUG
b3ef2d1999-12-18Martin Nilsson #define THROTTLING_DEBUG(X) werror("throttletags: "+X+"\n")
e658201999-09-29Francesco Chemolli #else #define THROTTLING_DEBUG(X) #endif #define THROW(X) throw( X+"\n" )
ad959c2000-02-12Martin Nilsson 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";
e658201999-09-29Francesco Chemolli 
920dcc1999-12-18Martin Nilsson TAGDOCUMENTATION; #ifdef manual
725ce62000-04-15Kenneth Johansson constant tagdoc=(["throttle":#"<desc tag><short>This tag determines a request's allocated bandwidth.</short></desc> <attr name=""> </attr>", "]);
920dcc1999-12-18Martin Nilsson #endif
e658201999-09-29Francesco Chemolli 
920dcc1999-12-18Martin Nilsson string|int tag_throttle(string tag, mapping args, RequestID id) {
e658201999-09-29Francesco Chemolli  mapping t=id->throttle; string tmp; if (t->fixed) { THROTTLING_DEBUG("Fixed. returning"); return 0; } if (args->not) { THROTTLING_DEBUG("Don