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 - 2009, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.684 2009/11/03 10:00:39 mast Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.685 2009/11/03 14:08:44 mast 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)      // Tell Pike.count_memory this is global.   constant pike_cycle_depth = 0;
Roxen.git/server/base_server/configuration.pike:3547:    else    report_error( "Call to start failed.\n"+describe_backtrace( error ));    }    invalidate_cache();    return 1;   }      RoxenModule reload_module( string modname )   {    RoxenModule old_module = find_module( modname ); -  ModuleInfo mi = roxen.find_module( (modname/"#")[0] ); +  sscanf (modname, "%s#%d", string base_modname, int mod_copy); +  ModuleInfo mi = roxen.find_module( base_modname );       if( !old_module ) return 0;       // Temporarily shift out of the rxml parsing context if we're inside    // any (e.g. due to delayed loading from inside the admin    // interface).    RXML.Context old_ctx = RXML.get_context();    RXML.set_context (0);    mixed err = catch {   
Roxen.git/server/base_server/configuration.pike:3572:    save_one( old_module );    master()->refresh_inherit( object_program( old_module ) );    master()->refresh( object_program( old_module ), 1 );    }       array old_error_log = (array) old_module->error_log;       RoxenModule nm;       // Load up a new instance. -  roxen->bootstrap_info->set (({this_object(), modname })); -  nm = mi->instance( this_object() ); -  roxen->bootstrap_info->set (0); -  +  nm = mi->instance( this_object(), 0, mod_copy);    // If this is a faked module, let's call it a failure.    if( nm->not_a_module )    {    old_module->report_error(LOC_C(385,"Reload failed")+"\n");    RXML.set_context (old_ctx);    return old_module;    }       disable_module( modname, 1 );    destruct( old_module );
Roxen.git/server/base_server/configuration.pike:3663:    while( modules[ modname ] && modules[ modname ][ id ] )    id++;      #ifdef DEBUG    if (mixed init_info = roxen->bootstrap_info->get())    if (arrayp (init_info))    error ("Invalid recursive call to enable_module while enabling %O/%s.\n",    init_info[0], init_info[1]);   #endif    -  roxen->bootstrap_info->set (({this_object(), modname + "#" + id})); -  +    #ifdef MODULE_DEBUG    int start_time = gethrtime();   #endif       if( !moduleinfo )    {    moduleinfo = roxen->find_module( modname );       if (!moduleinfo)    {    report_warning("Failed to load %s. The module probably "    "doesn't exist in the module path.\n", modname);    got_no_delayed_load = -1; -  roxen->bootstrap_info->set (0); +     return 0;    }    }       string descr = moduleinfo->get_name() + (id ? " copy " + (id + 1) : "");    // sscanf(descr, "%*s: %s", descr);      #ifdef MODULE_DEBUG    if (enable_module_batch_msgs)    report_debug(" %-43s... \b", descr );
Roxen.git/server/base_server/configuration.pike:3700:    report_debug("Enabling " + descr + "\n");   #endif       module = modules[ modname ];       if(!module)    modules[ modname ] = module = ModuleCopies();       if( !me )    { -  if(err = catch(me = moduleinfo->instance(this_object()))) +  if(err = catch(me = moduleinfo->instance(this_object(), 0, id)))    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");    if (err != "") {   #endif    string bt=describe_backtrace(err);    report_error("enable_module(): " +    LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));   #ifdef MODULE_DEBUG    }   #endif    got_no_delayed_load = -1; -  roxen->bootstrap_info->set (0); +     return module[id];    }    }       if(module[id] && module[id] != me)    {    if( module[id]->stop ) {    if (err = catch( call_module_func_with_cbs (module[id], "stop") )) {    string bt=describe_backtrace(err);    report_error("disable_module(): " +
Roxen.git/server/base_server/configuration.pike:3749:    {    if(module_type != MODULE_CONFIG)    {    if (err = catch {    me->defvar("_priority", 5, DLOCALE(12, "Priority"), TYPE_INT_LIST,    DLOCALE(13, "The priority of the module. 9 is highest and 0 is lowest."    " Modules with the same priority can be assumed to be "    "called in random order."),    ({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}));    }) { -  roxen->bootstrap_info->set (0); +     throw(err);    }    }      #ifdef MODULE_LEVEL_SECURITY    if( (module_type & ~(MODULE_LOGGER|MODULE_PROVIDER|MODULE_USERDB)) != 0 )    {   // me->defvar("_sec_group", "user", DLOCALE(14, "Security: Realm"),   // TYPE_STRING,   // DLOCALE(15, "The realm to use when requesting password from the "
Roxen.git/server/base_server/configuration.pike:3865:    } else {    me->defvar("_priority", 0, "", TYPE_INT, "", 0, 1);    }       if (!module[id])    counters[moduleinfo->counter]++;       module[ id ] = me;    otomod[ me ] = modname+"#"+id;    -  roxen->bootstrap_info->set (0); -  +     // Below we may have recursive calls to this function. They may    // occur already in setvars due to e.g. automatic dependencies in    // Variable.ModuleChoice.       mapping(string:mixed) stored_vars = retrieve(modname + "#" + id, this_object());    int has_stored_vars = sizeof (stored_vars); // A little ugly, but it suffices.    me->setvars(stored_vars);       if(!nostart) call_start_callbacks( me, moduleinfo, module );