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.695 2010/03/30 12:28:54 grubba Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.696 2010/05/06 22:41:25 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:640:   }      private int num_modules = 0;   #ifdef THREADS   private Thread.Condition modules_stopped = Thread.Condition();   private Thread.Mutex modules_stopped_mutex = Thread.Mutex();   #endif   private void safe_stop_module (RoxenModule mod, string desc)   {    if (mixed err = catch (mod && mod->stop && -  call_module_func_with_cbs (mod, "stop"))) +  call_module_func_with_cbs (mod, "stop", 0)))    report_error ("While stopping " + desc + ": " + describe_backtrace (err));   #ifdef THREADS    Thread.MutexKey lock = modules_stopped_mutex->lock();    if (!--num_modules)    modules_stopped->signal();    lock = 0;   #else    --num_modules;   #endif   }
Roxen.git/server/base_server/configuration.pike:3584:    // Load up a new instance.    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 ); +  disable_module( modname, nm );    destruct( old_module );       mixed err = catch {    mi->update_with( nm,0 ); // This is sort of nessesary...    };    if (err)    if (stringp (err)) {    // Error from the register_module call. We can't enable the old    // module now, and I don't dare changing the order so that    // register_module starts to get called before the old module is
Roxen.git/server/base_server/configuration.pike:3717: Inside #if defined(MODULE_DEBUG)
  #ifdef MODULE_DEBUG    }   #endif    got_no_delayed_load = -1;    return module[id];    }    }       if(module[id] && module[id] != me)    { +  // Don't know when this happens, because reload_module has already +  // called disable_module on the old instance.    if( module[id]->stop ) { -  if (err = catch( call_module_func_with_cbs (module[id], "stop") )) { +  if (err = catch( call_module_func_with_cbs (module[id], "stop", me) )) {    string bt=describe_backtrace(err);    report_error("disable_module(): " +    LOC_M(44, "Error while disabling module %s%s"),    descr, (bt ? ":\n"+bt : "\n"));    }    }    }       me->set_configuration( this_object() );   
Roxen.git/server/base_server/configuration.pike:4194:    foreach((port_info && port_info->ports) || ({}), Protocol prot) {    if ((prot->prot_name != "snmp") || (!prot->mib)) {    continue;    }       SNMP.remove_owned(prot->mib, this_object(), me);    }    }   }    - int disable_module( string modname, int|void nodest ) + int disable_module( string modname, void|RoxenModule new_instance )   {    MODULE_LOCK (2);    RoxenModule me;    int id;    sscanf(modname, "%s#%d", modname, id );       if( datacache ) datacache->flush();       ModuleInfo moduleinfo = roxen.find_module( modname );    mapping module = modules[ modname ];
Roxen.git/server/base_server/configuration.pike:4236:       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 (call_module_func_with_cbs (me, "stop"))) { +  if (mixed err = catch ( +  call_module_func_with_cbs (me, "stop", new_instance) +  )) {    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 );    -  if( !nodest ) +  if( !new_instance )    { -  +  // Not a reload, so it's being dropped.    m_delete( enabled_modules, modname + "#" + id );    m_delete( forcibly_added, modname + "#" + id );    store( "EnabledModules",enabled_modules, 1, this_object());    destruct(me);    }    return 1;   }      RoxenModule find_module(string name)   //! Return the module corresponding to the name (eg "rxmlparse",