Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.894 2005/02/23 17:01:03 grubba Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.895 2005/02/25 15:21:06 grubba Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:382:   }      /* Used by read_config.pike, since there seems to be problems with    * overloading otherwise.    */   static Privs PRIVS(string r, int|string|void u, int|string|void g)   {    return Privs(r, u, g);   }    + // Current Configuration. + Thread.Local current_configuration = Thread.Local(); +    // font cache and loading.   //   // This will be changed to a list of server global modules, to make it   // easier to implement new types of fonts (such as PPM color fonts, as   // an example)   class Fonts   {    class Font    {    Image.Image write( string ... what );
Roxen.git/server/base_server/roxen.pike:3270:    int|void nodraw )    //! Returns a @[result mapping] like one generated by    //! @[Roxen.http_file_answer()] but for the image file    //! rendered from the `data' instructions.    //!    //! Like @[metadata], a non-zero @[nodraw]parameter means an    //! image not already in the cache will not be rendered on the fly,    //! but instead zero will be returned (this will be seen as a 'File    //! not found' error)    { +  current_configuration->set(id->conf);    string na = store( data,id );    mixed res;   #ifdef ARG_CACHE_DEBUG    werror("data %O\n", na );   #endif    if(! (res=restore( na,id )) )    {    mixed err;    if (nodraw || (err = catch {    if (mapping res = draw( na, id ))
Roxen.git/server/base_server/roxen.pike:4773:    catch(signal(signum("SIGHUP"),async_sig_start(reload_all_configurations,1)));       // Signals which cause Roxen to dump the thread state    foreach( ({ "SIGBREAK", "SIGQUIT" }), string sig)    catch( signal(signum(sig),async_sig_start(describe_all_threads,-1)));       start_time=time(); // Used by the "uptime" info later on.       restart_suicide_checker();    + #ifdef ROXEN_DEBUG_MEMORY_TRACE +  restart_roxen_debug_memory_trace(); + #endif +    #ifndef __NT__    restart_if_stuck( 0 );   #endif   #ifdef __RUN_TRACE    trace(1);   #endif    return -1;   }      void check_commit_suicide()
Roxen.git/server/base_server/roxen.pike:4839:   }      void restart_suicide_checker()   {    remove_call_out(check_commit_suicide);    remove_call_out(check_suicide);    call_out(check_suicide, 60);    call_out(check_commit_suicide, 180); // Minimum uptime: 3 minutes.   }    + #ifdef ROXEN_DEBUG_MEMORY_TRACE + static object roxen_debug_info_obj; + void restart_roxen_debug_memory_trace() + { +  remove_call_out(restart_roxen_debug_memory_trace); +  +  if (!roxen_debug_info_obj) { +  roxen_debug_info_obj = ((program)"config_interface/actions/debug_info.pike" + )(); +  } +  int t = time(0); +  string html = roxen_debug_info_obj->parse((["real_variables":([])])); +  if (!Stdio.is_dir("../var/debug")) { +  mkdir("../var/debug"); +  } +  Stdio.write_file(sprintf("../var/debug/memory_info_%d.rxml", t), html); +  call_out(restart_roxen_debug_memory_trace, 5); + } + #endif +    // Called from the administration interface.   string check_variable(string name, mixed value)   {    switch(name)    {   #ifndef __NT__    case "abs_engage":    if (value)    // Make sure restart_if_stuck is called from the backend thread.    call_out(restart_if_stuck, 0, 1);