199d031999-09-05Francesco Chemolli /* * by Francesco Chemolli * (C) 1999 Idonex AB * * Notice: this might look ugly, it's been designed to be split into * a "library" program plus a tiny imlpementation module */
ad959c2000-02-12Martin Nilsson constant cvs_version="$Id: throttling_bytype.pike,v 1.5 2000/02/12 16:09:30 nilsson Exp $";
199d031999-09-05Francesco Chemolli  #include <module.h>
cdc2981999-09-29Francesco Chemolli inherit "throttlelib"; string filter_type="(by type)";
199d031999-09-05Francesco Chemolli  #ifdef THROTTLING_DEBUG #undef THROTTLING_DEBUG
b3ef2d1999-12-18Martin Nilsson #define THROTTLING_DEBUG(X) werror("Throttling: "+X+"\n")
199d031999-09-05Francesco Chemolli #else #define THROTTLING_DEBUG(X) #endif
ad959c2000-02-12Martin Nilsson constant module_type = MODULE_FILTER; constant module_name = "Throttling: throttle by type"; constant module_doc = "This module will alter the throttling definitions by content type"; constant module_unique = 0;
199d031999-09-05Francesco Chemolli 
cdc2981999-09-29Francesco Chemolli array find_rule (mapping res, object id, array(string) rulenames, mapping rules) {
199d031999-09-05Francesco Chemolli  if (!res) return 0;
cdc2981999-09-29Francesco Chemolli  return low_find_rule(res->type, rulenames, rules);
199d031999-09-05Francesco Chemolli }