Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS. - constant cvs_version = "$Id: configuration.pike,v 1.421 2001/03/08 15:34:57 per Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.422 2001/03/12 14:05:02 nilsson 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>   //<locale-token project="roxen_config"> LOC_C </locale-token>   //<locale-token project="roxen_message"> LOC_M </locale-token>   //<locale-token project="roxen_config"> DLOCALE </locale-token>   #define LOC_S(X,Y) _STR_LOCALE("roxen_start",X,Y)   #define LOC_C(X,Y) _STR_LOCALE("roxen_config",X,Y)   #define LOC_M(X,Y) _STR_LOCALE("roxen_message",X,Y)   #define DLOCALE(X,Y) _DEF_LOCALE("roxen_config",X,Y)      #ifdef THROTTLING_DEBUG   #undef THROTTLING_DEBUG - #define THROTTLING_DEBUG(X) werror("Throttling: "+X+"\n") + #define THROTTLING_DEBUG(X) report_debug("Throttling: "+X+"\n")   #else   #define THROTTLING_DEBUG(X)   #endif      #ifdef REQUEST_DEBUG - # define REQUEST_WERR(X) werror("CONFIG: "+X+"\n") + # define REQUEST_WERR(X) report_debug("CONFIG: "+X+"\n")   #else   # define REQUEST_WERR(X)   #endif      /* A configuration.. */   inherit Configuration;   inherit "basic_defvar";      // Trivial cache (actually, it's more or less identical to the 200+   // lines of C in HTTPLoop. But it does not have to bother with the
Roxen.git/server/base_server/configuration.pike:968: Inside #if defined(THREADS)
   TIMER_START(module_lock);    if (functionp(f)) {    f = function_object(f);    }    if (l = locks[f])    {    if (l != -1)    {    // Allow recursive locks.    catch{ -  //werror("lock %O\n", f); +  // report_debug("lock %O\n", f);    locked[f]++;    key = l();    };    } else    thread_safe[f]++;    } else if (f->thread_safe) {    locks[f]=-1;    thread_safe[f]++;    } else {    if (!locks[f])    {    // Needed to avoid race-condition.    l = Thread.Mutex()->lock;    if (!locks[f]) {    locks[f]=l;    }    } -  //werror("lock %O\n", f); +  // report_debug("lock %O\n", f);    locked[f]++;    key = l();    }    TIMER_END(module_lock);    return key;   }      #define LOCK(X) key=_lock(X)   #define UNLOCK() do{key=0;}while(0)   #else
Roxen.git/server/base_server/configuration.pike:1767:    return id->conf->open_file(fname, mode,id, internal_get);    }    fname = id->not_query;       if(search(mode, "R")!=-1) // raw (as in not parsed..)    {    string f;    mode -= "R";    if(f = real_file(fname, id))    { -  // werror("opening "+fname+" in raw mode.\n"); +  // report_debug("opening "+fname+" in raw mode.\n");    return ({ open(f, mode), ([]) });    }   // return ({ 0, (["error":302]) });    }       if(mode=="r")    {    if(!file)    {    file = get_file( id, 0, internal_get );
Roxen.git/server/base_server/configuration.pike:1849: Inside #if defined(URL_MODULES)
   id->not_query = file;    LOCK(funp);    TRACE_ENTER("URL module", funp);    tmp=funp( id, file );    UNLOCK();       if(mappingp( tmp ))    {    id->not_query=of;   #ifdef MODULE_DEBUG -  werror("conf->find_dir_stat(\"%s\"): url_module returned mapping:%O\n", +  report_debug("conf->find_dir_stat(\"%s\"): url_module returned mapping:%O\n",    file, tmp);   #endif /* MODULE_DEBUG */    TRACE_LEAVE("Returned mapping."+sprintf("%O", tmp));    TRACE_LEAVE("");    return 0;    }    if(objectp( tmp ))    {    array err;    nest ++;
Roxen.git/server/base_server/configuration.pike:1875: Inside #if defined(URL_MODULES)
   else {    TRACE_LEAVE("Too deep recursion");    error("Too deep recursion in roxen::find_dir_stat() while mapping "    +file+".\n");    }    };    nest = 0;    if(err)    throw(err);   #ifdef MODULE_DEBUG -  werror("conf->find_dir_stat(\"%s\"): url_module returned object:\n", +  report_debug("conf->find_dir_stat(\"%s\"): url_module returned object:\n",    file);   #endif /* MODULE_DEBUG */    TRACE_LEAVE("Returned object.");    TRACE_LEAVE("Returning it.");    return tmp; // FIXME: Return 0 instead?    }    id->not_query=of;    TRACE_LEAVE("");    }   #endif /* URL_MODULES */
Roxen.git/server/base_server/configuration.pike:3266:   </font>   </body>   ",    DLOCALE(58, "No such file message"),    TYPE_TEXT_FIELD|VAR_PUBLIC,    DLOCALE(59, "What to return when there is no resource or file "    "available at a certain location."));       definvisvar( "no_delayed_load", 0, TYPE_FLAG|VAR_PUBLIC );    - // werror("[defvar: %.1fms] ", (gethrtime()-st)/1000.0 ); + // report_debug("[defvar: %.1fms] ", (gethrtime()-st)/1000.0 );   // st = gethrtime();    setvars( retrieve("spider#0", this_object()) );    - // werror("[restore: %.1fms] ", (gethrtime()-st)/1000.0 ); + // report_debug("[restore: %.1fms] ", (gethrtime()-st)/1000.0 );    if (query("throttle"))    {    throttler=.throttler();    throttler->throttle(query("throttle_fill_rate"),    query("throttle_bucket_depth"),    query("throttle_min_grant"),    query("throttle_max_grant"));    }   }      static int arent_we_throttling_server () {    return !query("throttle");   }   static int arent_we_throttling_request() {    return !query("req_throttle");   }