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 - 2004, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.596 2005/11/24 17:36:50 grubba Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.597 2005/11/28 14:43:32 grubba 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:247:    array q = indices( cache );    if(!sizeof(q))    {    current_size=0;    return;    }    for( int i = 0; i<sizeof( q )/10; i++ )    expire_entry( q[random(sizeof(q))] );    }    -  void expire_entry( string url ) +  void expire_entry(string url, string|void host)    { -  +  if (host_in_key) { +  url = (host|"") + "\0" + url; +  } else { +  // Forward compat in case host_in_key is enabled later... +  url = "\0" + url; +  }    if( cache[ url ] )    {    current_size -= strlen(cache[url][0]);    m_delete( cache, url );    }    }       void set(string url, string data, mapping meta, int expire,    string|void host)    {    if( strlen( data ) > max_file_size ) return; -  call_out( expire_entry, expire, url ); +  call_out(expire_entry, expire, url, host); +  +  if (host_in_key) { +  url = (host|"") + "\0" + url; +  } else { +  // Forward compat in case host_in_key is enabled later... +  url = "\0" + url; +  }    current_size += strlen( data );    cache[url] = ({ data, meta });    int n;    while( (current_size > max_size) && (n++<10))    clear_some_cache();    }       array(string|mapping(string:mixed)) get(string url, string|void host)    {    mixed res;