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.363 2000/09/05 15:06:28 per Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.364 2000/09/08 18:41:25 mast Exp $";   constant is_configuration = 1;   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>      inherit "basic_defvar";      mapping enabled_modules = ([]);   mapping(string:array(int)) error_log=([]);
Roxen.git/server/base_server/configuration.pike:2148: Inside #if defined(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;    return module[id];    }    }       if(module[id] && module[id] != me)    {    if( module[id]->stop )    module[id]->stop();   // if( err = catch( disable_module( modname+"#"+id ) ) )   // report_error(LOCALE->error_disabling_module(moduleinfo->get_name(),
Roxen.git/server/base_server/configuration.pike:2278:   #endif    if( !enabled_modules[modname+"#"+id] )    {    enabled_modules[modname+"#"+id] = 1;    store( "EnabledModules", enabled_modules, 1, this_object());    }       if (!has_stored_vars)    store (modname + "#" + id, me->query(), 0, this_object());    -  if( me->no_delayed_load ) -  set( "no_delayed_load", 1 ); +  if( me->no_delayed_load && got_no_delayed_load >= 0 ) +  got_no_delayed_load = 1;       return me;   }      void call_start_callbacks( RoxenModule me,    ModuleInfo moduleinfo,    ModuleCopies module )   {    call_low_start_callbacks( me, moduleinfo, module );       mixed err;    if((me->start) && (err = catch( me->start(0, this_object()) ) ) )    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs)    report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err);    report_error(LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n")); -  +  got_no_delayed_load = -1;    /* Clean up some broken references to this module. */   // m_delete(otomod, me);   // m_delete(module->copies, search( module->copies, me ));   // destruct(me);   // return 0;    }    if( inited && me->ready_to_receive_requests )    if( mixed q = catch( me->ready_to_receive_requests( this_object() ) ) )    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    report_error( "While calling ready_to_receive_requests:\n"+    describe_backtrace( q ) ); -  +  got_no_delayed_load = -1;    } -  -  if( me->no_delayed_load ) -  save_me(); +    }      void call_low_start_callbacks( RoxenModule me,    ModuleInfo moduleinfo,    ModuleCopies module )   {    int module_type = moduleinfo->type, pr;    mixed err;    if (err = catch(pr = me->query("_priority")))    {
Roxen.git/server/base_server/configuration.pike:2367:    else    pri[pr]->file_extension_modules[foo]=({me});    }    }) {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err);    report_error(LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n")); +  got_no_delayed_load = -1;    }       if(module_type & MODULE_PROVIDER)    if (err = catch    {    mixed provs = me->query_provides();    if(stringp(provs))    provs = (< provs >);    if(arrayp(provs))    provs = mkmultiset(provs);    if (multisetp(provs)) {    pri[pr]->provider_modules [ me ] = provs;    }    }) {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err);    report_error(LOC_M(41, "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n")); -  +  got_no_delayed_load = -1;    }       if(module_type & MODULE_TYPES)    {    types_module = me;    types_fun = me->type_from_extension;    }       if(module_type & MODULE_PARSER)    add_parse_module( me );
Roxen.git/server/base_server/configuration.pike:2682:      array after_init_hooks = ({});   mixed add_init_hook( mixed what )   {    if( inited )    call_out( what, 0, this_object() );    else    after_init_hooks |= ({ what });   }    + static int got_no_delayed_load; + // 0 -> enabled delayed loading, 1 -> disable delayed loading, + // -1 -> don't change. +    void enable_all_modules()   {    MODULE_LOCK;    int q = query( "no_delayed_load" ); -  set( "no_delayed_load", 0 ); +  got_no_delayed_load = 0;    low_init( ); -  if( q != query( "no_delayed_load" ) ) +  if( got_no_delayed_load >= 0 && q != got_no_delayed_load ) { +  set( "no_delayed_load", got_no_delayed_load );    save_one( 0 );    } -  + }      void low_init()   {    if( inited )    return; // already done       int start_time = gethrtime();    report_debug("\nEnabling all modules for "+query_name()+"... \n");       add_parse_module( (object)this_object() );
Roxen.git/server/base_server/configuration.pike:2718:    // Always enable the user database module first.    if(search(modules_to_process, "userdb#0")>-1)    modules_to_process = (({"userdb#0"})+(modules_to_process-({"userdb#0"})));       array err;    forcibly_added = (<>);    enable_module_batch_msgs = 1;    foreach( modules_to_process, tmp_string )    {    if( !forcibly_added[ tmp_string ] ) -  if(err = catch( enable_module( tmp_string ))) +  if(err = catch( enable_module( tmp_string ))) {    report_error(LOC_M(45, "Failed to enable the module %s. Skipping.\n%s"),    tmp_string, describe_backtrace(err)); -  +  got_no_delayed_load = -1;    } -  +  }    enable_module_batch_msgs = 0;    roxenloader.pop_compile_error_handler();    if( strlen( ec->get() ) )    report_error( "While enabling modules in "+name+":\n"+ec->get() );    if( strlen( ec->get_warnings() ) )    report_warning( "While enabling modules in "+name+":\n"+ec->get_warnings());       foreach( ({this_object()})+indices( otomod ), object mod )    if( mod->ready_to_receive_requests ) -  if( mixed q = catch( mod->ready_to_receive_requests( this_object() ) ) ) +  if( mixed q = catch( mod->ready_to_receive_requests( this_object() ) ) ) {    report_error( "While calling ready_to_receive_requests in "+    otomod[mod]+":\n"+    describe_backtrace( q ) ); -  +  got_no_delayed_load = -1; +  }       foreach( after_init_hooks, function q ) -  if( mixed w = catch( q(this_object()) ) ) +  if( mixed w = catch( q(this_object()) ) ) {    report_error( "While calling after_init_hook %O:\n%s",    q, describe_backtrace( w ) ); -  +  got_no_delayed_load = -1; +  }       after_init_hooks = ({});       inited = 1;    report_notice(LOC_S(4, "All modules for %s enabled in %3.1f seconds") +    "\n\n", query_name(), (gethrtime()-start_time)/1000000.0);   }         // Trivial cache (actually, it's more or less identical to the 200+