Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // This file is part of Internet Server.   // Copyright © 1996 - 2001, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.533 2002/07/08 11:06:36 nilsson Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.534 2002/07/22 14:48:15 nilsson 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)      #ifdef THROTTLING_DEBUG   #undef THROTTLING_DEBUG
Roxen.git/server/base_server/configuration.pike:1298:    TRACE_ENTER(sprintf("Request for %s", id->not_query), 0);       string file=id->not_query;    string loc;    function funp;    mixed tmp, tmp2;    mapping|object(Stdio.File)|int fid;       if(!no_magic)    { +  // NGSERVER: Remove the /internal-foo-bar and use only /%00/bar    TIMER_START(internal_magic);   #ifndef NO_INTERNAL_HACK    // Find internal-foo-bar images    // min length == 17 (/internal-roxen-?..)    // This will save some time indeed.    string type; -  if(sizeof(file) > 17 && +  if((sizeof(file) > 17 &&   #if ROXEN_COMPAT <= 2.1    (file[0] == '/') &&    sscanf(file, "%*s/internal-%s-%[^/]", type, loc) == 3   #else    sscanf(file, "/internal-%s-%[^/]", type, loc) == 2   #endif -  ) { +  ) || (sizeof(file)>3 && file[1]==0 && sscanf(file, "/\0/%s", loc)==1 && (type="roxen")) ) {    switch(type) {    case "roxen":    // Mark all /internal-roxen-* as cacheable even though the user might be    // authenticated (which normally disables protocol-level caching).    id->misc->cacheable = 9999;       TRACE_LEAVE("Magic internal roxen image");    if(loc=="unit" || loc=="pixel-of-destiny")    {    TIMER_END(internal_magic);    return (["data":"GIF89a\1\0\1\0\200ÿ\0ÀÀÀ\0\0\0!ù\4\1\0\0\0\0,"    "\0\0\0\0\1\0\1\0\0\1\1""2\0;",    "type":"image/gif", -  "stat": ({0, 0, 0, 900000000, 0, 0, 0})]); +  "stat": ({0, 42, 0, 900000000, 0, 0, 0})]);    }    if(has_prefix(loc, "pixel-"))    {    TIMER_END(internal_magic);    return (["data":sprintf("GIF89a\1\0\1\0\200\0\0\0\0\0%c%c%c,\0\0\0"    "\0\1\0\1\0\0\2\2L\1\0;",    @parse_color(loc[6..])),    "type":"image/gif", -  "stat": ({0, 0, 0, 900000000, 0, 0, 0})]); +  "stat": ({0, 35, 0, 900000000, 0, 0, 0})]);    }    TIMER_END(internal_magic);    return internal_roxen_image(loc, id);       case "gopher":    TRACE_LEAVE("Magic internal gopher image");    TIMER_END(internal_magic);    return internal_gopher_image(loc);    }    }