Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2001, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.512 2002/05/13 15:55:44 jonasw Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.513 2002/05/16 12:28:41 stewa Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>   #include <timers.h>      #define CATCH(P,X) do{mixed e;if(e=catch{X;})report_error("While "+P+"\n"+describe_backtrace(e));}while(0)      // --- Locale defines ---   //<locale-token project="roxen_start"> LOC_S </locale-token>
Roxen.git/server/base_server/configuration.pike:1730:   }      mapping get_file(RequestID id, int|void no_magic, int|void internal_get)   //! Return a result mapping for the id object at hand, mapping all   //! modules, including the filter modules. This function is mostly a   //! wrapper for <ref>low_get_file()</ref>.   {    TIMER_START(get_file);    int orig_internal_get = id->misc->internal_get;    id->misc->internal_get = internal_get; +  RequestID root_id = id->root_id || id; +  int sub_req_limit = query("SubRequestLimit"); +  root_id->misc->_request_depth++; +  if(sub_req_limit && root_id->misc->_request_depth > sub_req_limit) +  throw( ({ "Subrequest limit reached. (Possibly an insertion loop.)", backtrace() }) );       mapping|int res;    mapping res2;    function tmp;    res = low_get_file(id, no_magic);    TIMER_END(get_file);       // finally map all filter type modules.    // Filter modules are like TYPE_LAST modules, but they get called    // for _all_ files.
Roxen.git/server/base_server/configuration.pike:1757:    if(res && res->file && (res2->file != res->file))    destruct(res->file);    TRACE_LEAVE("Rewrote result.");    res=res2;    } else    TRACE_LEAVE("");    PROF_LEAVE(Roxen.get_owning_module(tmp)->module_name,"filter");    }    TIMER_END(filter_modules);    +  root_id->misc->_request_depth--;    id->misc->internal_get = orig_internal_get;    return res;   }      array(string) find_dir(string file, RequestID id, void|int(0..1) verbose)   {    array dir;    TRACE_ENTER(sprintf("List directory %O.", file), 0);       if(!sizeof (file) || file[0] != '/')
Roxen.git/server/base_server/configuration.pike:3456:       defvar("InternalLoc", "/_internal/",    DLOCALE(40, "Internal module resource mountpoint"),    TYPE_LOCATION|VAR_MORE|VAR_DEVELOPER,    DLOCALE(41, "Some modules may want to create links to internal "    "resources. This setting configures an internally handled "    "location that can be used for such purposes. Simply select "    "a location that you are not likely to use for regular "    "resources."));    +  defvar("SubRequestLimit", 30, +  "Subrequest depth limit", +  TYPE_INT | VAR_MORE, +  "A limit for the number of nested sub requests for each request. " +  "This is intented to catch unintended infinite loops when for example " +  "inserting files in RXML. 0 for no limit." );       // Throttling-related variables       defvar("throttle", 0,    DLOCALE(42, "Throttling: Server; Enabled"),TYPE_FLAG,    DLOCALE(43, "If set, per-server bandwidth throttling will be enabled. "    "It will allow you to limit the total available bandwidth for "    "this site.<br />Bandwidth is assigned using a Token Bucket. "    "The principle under which it works is: for each byte we send we use a token. "    "Tokens are added to a repository at a constant rate. When there's not enough, "