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.   //   // A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.444 2001/06/30 15:44:04 mast Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.445 2001/06/30 21:56:09 hop 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:2858:    case "throttle_bucket_depth":    case "throttle_min_grant":    case "throttle_max_grant":    THROTTLING_DEBUG("configuration: setting throttling parameter: "+    name+"="+value);    throttler->throttle(query("throttle_fill_rate"),    query("throttle_bucket_depth"),    query("throttle_min_grant"),    query("throttle_max_grant"));    return 0; + #ifdef SNMP_AGENT +  case "snmp_process": +  if (objectp(roxen->snmpagent)) { +  int cid = get_config_id(); +  value ? roxen->snmpagent->add_virtserv(cid) : roxen->snmpagent->del_virtserv(cid);    } -  +  return 0; + #endif    } -  + }      void module_changed( ModuleInfo moduleinfo,    RoxenModule me )   {    clean_up_for_module( moduleinfo, me );    call_low_start_callbacks( me,    moduleinfo,    modules[ moduleinfo->sname ] );   }   
Roxen.git/server/base_server/configuration.pike:3490:      // 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, +  "SNMP: Enabled",TYPE_FLAG, +  "If set, per-server objects will be added to the SNMP agent database.", +  0, snmp_global_disabled); +  defvar("snmp_community", "public:ro", +  "SNMP: Community string", TYPE_STRING, +  "The community string and access level for manipulation on server " +  " specific objects.", +  0, snmp_disabled); +  +  if (query("snmp_process")) { +  if(objectp(roxen()->snmpagent)) { +  int servid; +  servid = roxen()->snmpagent->add_virtserv(); +  // todo: make invisible varibale and set it to this value for future reference +  } else +  report_error("SNMPagent: something gets wrong! The main agent is disabled!\n"); } + #endif +    }      static int arent_we_throttling_server () {    return !query("throttle");   }   static int arent_we_throttling_request() {    return !query("req_throttle");   } -  +  + #ifdef SNMP_AGENT + private static int(0..1) snmp_disabled() { +  return (!snmp_global_disabled() && !query("snmp_process")); + } + private static int(0..1) snmp_global_disabled() { (!objectp(roxen->snmpagent)); } + #endif +