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.956 2007/08/15 09:21:46 wellhard Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.957 2007/09/20 10:28:17 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:1758:    return sprintf("%d.%d.%d.%d", @((array(int))bytes));    }    }       static void setup (int pn, string i)    {    port = pn;    ip = canonical_ip(i);       restore(); +  if (sizeof(requesthandlerfile)) {    if( file_stat( "../local/"+requesthandlerfile ) )    rrhf = "../local/"+requesthandlerfile;    else    rrhf = requesthandlerfile;    DDUMP( rrhf );   #ifdef DEBUG    if( !requesthandler )    requesthandler = (program)(rrhf);   #endif -  +  }    bound = 0;    port_obj = 0;    retries = 0;    }       static void create( int pn, string i )    //! Constructor. Bind to the port 'pn' ip 'i'    {    setup (pn, i);    bind();
Roxen.git/server/base_server/roxen.pike:4542:   {    // FIXME: This code is probably not thread-safe!    if( charset == "iso-8859-1" ) return data;    if( !cached_decoders[ charset ] )    cached_decoders[ charset ] = Locale.Charset.decoder( charset );    data = cached_decoders[ charset ]->feed( data )->drain();    cached_decoders[ charset ]->clear();    return data;   }    + //! Check if a cache key has been marked invalid (aka stale). + int(0..1) invalidp(CacheKey key) + { +  catch { +  return !key || (key->invalidp && key->invalidp()); +  }; +  return !key; + } +  + //! Invalidate (mark as stale) a cache key. + void invalidate(CacheKey key) + { +  if (!key) return; +  catch { +  if (key->invalidate) { +  key->invalidate(); +  return; +  } +  }; +  if (key) destruct(key); + } +    void create()   {    // Register localization projects   #define __REG_PROJ Locale.register_project    __REG_PROJ("roxen_""start", "translations/%L/roxen_start.xml");    __REG_PROJ("roxen_""config", "translations/%L/roxen_config.xml");    __REG_PROJ("roxen_""message", "translations/%L/roxen_message.xml");    __REG_PROJ("admin_""tasks", "translations/%L/admin_tasks.xml");    Locale.set_default_project_path("translations/%L/%P.xml");   #undef __REG_PROJ