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.448 2001/07/11 02:31:35 mast Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.449 2001/07/12 21:22:35 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)      // --- Locale defines ---   //<locale-token project="roxen_start"> LOC_S </locale-token>
Roxen.git/server/base_server/configuration.pike:2397:       master()->clear_compilation_failures();       if( !old_module->fake )    {    save_one( old_module );    master()->refresh_inherit( object_program( old_module ) );    master()->refresh( object_program( old_module ), 1 );    }    -  catch( disable_module( modname, 1 ) ); +  if (mixed err = catch( disable_module( modname, 1 ) )) +  // Actually, I believe the catch here is unnecessary. /mast +  report_error ("Error doing reload of %O:\n%s", +  modname, describe_backtrace (err));    -  RoxenModule nm; +  array old_error_log = (array) old_module->error_log;    -  if( catch( nm = enable_module( modname, 0, 0, 1 ) ) || (nm == 0) ) -  enable_module( modname, (nm=old_module), mi, 1 ); -  else -  { -  foreach ((array) old_module->error_log, [string msg, array(int) times]) -  nm->error_log[msg] += times; -  -  ModuleInfo mi = roxen.find_module( (modname/"#")[0] ); -  catch( mi->update_with( nm,0 ) ); // This is sort of nessesary... -  -  nm->report_notice(LOC_C(11, "Reloaded %s.")+"\n", mi->get_name()); +     // It's possible e.g. in the admin interface that the module    // being reloaded is in use for the current request, so delay it a    // little.    //call_out (destruct, 2, old_module);    // Nope, can't do that since there are things like lookup caches    // that count on that the old module object is gone before the new    // is started. -  destruct (old_module); -  } +  if (mixed err = catch (destruct (old_module))) +  report_error ("Error destructing module instance of %O:\n%s", +  modname, describe_backtrace (err));    -  +  RoxenModule nm; +  +  if( mixed err = catch( nm = enable_module( modname, 0, 0, 1 ) ) ) +  // Actually, I believe the catch here is unnecessary. /mast +  report_error ("Error doing reload of %O:\n%s", +  modname, describe_backtrace (err)); +  +  if (!nm) return 0; +  +  foreach (old_error_log, [string msg, array(int) times]) +  nm->error_log[msg] += times; +  +  mi = roxen.find_module( (modname/"#")[0] ); +  catch( mi->update_with( nm,0 ) ); // This is sort of nessesary... +  +  nm->report_notice(LOC_C(11, "Reloaded %s.")+"\n", mi->get_name()); +     call_start_callbacks( nm, mi, modules[ (modname/"#")[0] ] );       return nm;   }      #ifdef THREADS   Thread.Mutex enable_modules_mutex = Thread.Mutex();   #define MODULE_LOCK \    Thread.MutexKey enable_modules_lock = enable_modules_mutex->lock (2)   #else