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 */
cdc2981999-09-29Francesco Chemolli constant cvs_version="$Id: throttling_bytype.pike,v 1.3 1999/09/29 20:29:38 kinkie 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 #define THROTTLING_DEBUG(X) perror("Throttling: "+X+"\n") #else #define THROTTLING_DEBUG(X) #endif array register_module() { return ({ MODULE_FILTER, "Throttling: throttle by type", "This module will alter the throttling definitions by content type", 0,0}); }
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 }