Roxen.git / server / modules / throttling / throttling_bytype.pike

version» Context lines:

Roxen.git/server/modules/throttling/throttling_bytype.pike:1:   /*    * by Francesco Chemolli -  * This is a roxen module. Copyright © 1999 - 2000, Roxen IS. +  * This is a roxen module. Copyright © 1999 - 2009, Roxen IS.    *    * Notice: this might look ugly, it's been designed to be split into    * a "library" program plus a tiny imlpementation module    */    - constant cvs_version="$Id: throttling_bytype.pike,v 1.8 2000/05/15 20:05:41 kinkie Exp $"; + constant cvs_version="$Id$";      #include <module.h>   inherit "throttlelib";      string filter_type="(by type)";   string rules_doc=   #"Throttling rules. One rule per line, whose format is:<br>   <tt>type-glob modifier [fix]</tt><br>   <tt>type-glob</tt> is matched on the Content Type header.   (i.e. <tt>image/gif</tt> or <tt>text/html</tt>).<p>
Roxen.git/server/modules/throttling/throttling_bytype.pike:42:   #endif      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 = 1;      array find_rule (mapping res, object id,    array(string) rulenames, mapping rules) {    if (!res) return 0; -  return low_find_rule(res->type, rulenames, rules); +  string|array(string) type = res->type; +  if (arrayp(type)) +  type = type[0]; +  return low_find_rule(type, rulenames, rules);   }