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.387 2000/11/02 08:30:38 per Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.388 2000/11/02 08:48:45 per Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.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:2466:    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;    }   }    - int disable_module( string modname, int|void nodest ) + void module_changed( ModuleInfo moduleinfo, +  RoxenModule me )   { -  MODULE_LOCK; -  RoxenModule me; -  int id, pr; -  sscanf(modname, "%s#%d", modname, id ); -  -  if( datacache ) datacache->flush(); -  -  ModuleInfo moduleinfo = roxen.find_module( modname ); -  mapping module = modules[ modname ]; -  string descr = moduleinfo->get_name() + (id ? " copy " + (id + 1) : ""); -  -  if(!module) -  { -  report_error("disable_module(): " + -  LOC_M(42, "Failed to disable module:\n" -  "No module by that name: \"%s\".\n"), modname); -  return 0; +  clean_up_for_module( moduleinfo, me ); +  call_low_start_callbacks( me, +  moduleinfo, +  modules[ moduleinfo->sname ] );   }    -  me = module[id]; -  m_delete(module->copies, id); -  -  if(!sizeof(module->copies)) -  m_delete( modules, modname ); -  -  invalidate_cache(); -  -  if(!me) + void clean_up_for_module( ModuleInfo moduleinfo, +  RoxenModule me )   { -  report_error("disable_module(): " + -  LOC_M(43, "Failed to disable module \"%s\".\n"), -  descr); -  return 0; -  } -  -  if(me->stop) -  if (mixed err = catch (me->stop())) { -  string bt=describe_backtrace(err); -  report_error("disable_module(): " + -  LOC_M(44, "Error while disabling module %s%s"), -  descr, (bt ? ":\n"+bt : "\n")); -  } -  - #ifdef MODULE_DEBUG -  report_debug("Disabling "+descr+"\n"); - #endif -  +  int pr;    if(moduleinfo->type & MODULE_FILE_EXTENSION)    {    string foo;    for(pr=0; pr<10; pr++)    foreach( indices (pri[pr]->file_extension_modules), foo )    pri[pr]->file_extension_modules[foo]-=({me});    }       if(moduleinfo->type & MODULE_PROVIDER) {    for(pr=0; pr<10; pr++)
Roxen.git/server/base_server/configuration.pike:2546:       if( moduleinfo->type & MODULE_AUTH )    {    auth_module = 0;    auth_fun = 0;    }       if( moduleinfo->type & MODULE_DIRECTORIES )    dir_module = 0;    -  +     if( moduleinfo->type & MODULE_LOCATION )    for(pr=0; pr<10; pr++)    pri[pr]->location_modules -= ({ me });       if( moduleinfo->type & MODULE_URL )    for(pr=0; pr<10; pr++)    pri[pr]->url_modules -= ({ me });       if( moduleinfo->type & MODULE_LAST )    for(pr=0; pr<10; pr++)
Roxen.git/server/base_server/configuration.pike:2571:    pri[pr]->filter_modules -= ({ me });       if( moduleinfo->type & MODULE_FIRST ) {    for(pr=0; pr<10; pr++)    pri[pr]->first_modules -= ({ me });    }       if( moduleinfo->type & MODULE_LOGGER )    for(pr=0; pr<10; pr++)    pri[pr]->logger_modules -= ({ me }); + }    -  + int disable_module( string modname, int|void nodest ) + { +  MODULE_LOCK; +  RoxenModule me; +  int id, pr; +  sscanf(modname, "%s#%d", modname, id );    -  +  if( datacache ) datacache->flush(); +  +  ModuleInfo moduleinfo = roxen.find_module( modname ); +  mapping module = modules[ modname ]; +  string descr = moduleinfo->get_name() + (id ? " copy " + (id + 1) : ""); +  +  if(!module) +  { +  report_error("disable_module(): " + +  LOC_M(42, "Failed to disable module:\n" +  "No module by that name: \"%s\".\n"), modname); +  return 0; +  } +  +  me = module[id]; +  m_delete(module->copies, id); +  +  if(!sizeof(module->copies)) +  m_delete( modules, modname ); +  +  invalidate_cache(); +  +  if(!me) +  { +  report_error("disable_module(): " + +  LOC_M(43, "Failed to disable module \"%s\".\n"), +  descr); +  return 0; +  } +  +  if(me->stop) +  if (mixed err = catch (me->stop())) { +  string bt=describe_backtrace(err); +  report_error("disable_module(): " + +  LOC_M(44, "Error while disabling module %s%s"), +  descr, (bt ? ":\n"+bt : "\n")); +  } +  + #ifdef MODULE_DEBUG +  report_debug("Disabling "+descr+"\n"); + #endif +  +  clean_up_for_module( moduleinfo, me ); +     m_delete( enabled_modules, modname + "#" + id );    forcibly_added[ modname + "#" + id ] = 0;    store( "EnabledModules",enabled_modules, 1, this_object());       if(!nodest)    destruct(me);    return 1;   }      RoxenModule find_module(string name)