Branch: Tag:

2001-07-19

2001-07-19 20:23:02 by Honza Petrous <hop@unibase.cz>

Moved defvars, so now are per-server configuration variables persistent.

Rev: server/base_server/configuration.pike:1.451
Rev: server/base_server/snmpagent.pike:1.6

3:   //   // A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.450 2001/07/18 21:10:03 hop Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.451 2001/07/19 20:23:02 hop Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>
3503:    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 ); -  - // report_debug("[defvar: %.1fms] ", (gethrtime()-st)/1000.0 ); - // st = gethrtime(); -  -  mapping(string:mixed) retrieved_vars = retrieve("spider#0", this_object()); -  if (sizeof (retrieved_vars) && !retrieved_vars->compat_level) -  // Upgrading an older configuration; default to 2.1 compatibility level. -  set ("compat_level", "2.1"); -  setvars( retrieved_vars ); -  - // 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")); -  } +    #ifdef SNMP_AGENT    // SNMP stuffs    defvar("snmp_process", 0,
3541: Inside #if defined(SNMP_AGENT)
   if (query("snmp_process")) {    if(objectp(roxen()->snmpagent)) {    int servid; -  servid = roxen()->snmpagent->add_virtserv(); +  servid = roxen()->snmpagent->add_virtserv(get_config_id());    // todo: make invisible varibale and set it to this value for future reference    // (support for per-reload persistence of server index?)    } else    report_error("SNMPagent: something gets wrong! The main agent is disabled!\n"); }   #endif    -  +  +  definvisvar( "no_delayed_load", 0, TYPE_FLAG|VAR_PUBLIC ); +  + // report_debug("[defvar: %.1fms] ", (gethrtime()-st)/1000.0 ); + // st = gethrtime(); +  +  mapping(string:mixed) retrieved_vars = retrieve("spider#0", this_object()); +  if (sizeof (retrieved_vars) && !retrieved_vars->compat_level) +  // Upgrading an older configuration; default to 2.1 compatibility level. +  set ("compat_level", "2.1"); +  setvars( retrieved_vars ); +  + // 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");