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.1024 2009/02/19 16:27:10 jonasw Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1025 2009/03/20 14:38: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:3131:    }       protected void|mapping draw( string name, RequestID id )    {   #ifdef ARG_CACHE_DEBUG    werror("draw %O\n", name );   #endif    mixed args = Array.map( Array.map( name/"$", argcache->lookup,    id->client ), frommapp);    +  id->cache_status["icachedraw"] = 1; +     mapping meta;    string data;    array guides;    mixed reply = draw_function( @copy_value(args), id );       if( !reply ) {   #ifdef ARG_CACHE_DEBUG    werror("%O(%{%O, %}%O) ==> 0\n",    draw_function, args, id);   #endif
Roxen.git/server/base_server/roxen.pike:3825:    uid_cache[id] = uid;    }       if( uid && strlen(uid) )    {    User u;    if( !(u=rid->conf->authenticate(rid)) || (u->name() != uid ) )    return rid->conf->authenticate_throw(rid, "User");    }    -  if( rst_cache[ id ] ) +  if( rst_cache[ id ] ) { +  rid->cache_status["icacheram"] = 1;    return rst_cache[ id ] + ([]); -  +  }      #ifdef ARG_CACHE_DEBUG    werror("restore %O\n", id );   #endif    q = QUERY( "SELECT meta,atime,data FROM "+name+" WHERE id=%s",id);    if( sizeof(q) )    {    if( sizeof(q[0]->data) )    {    // Case 1: We have cache entry and image.    string f = q[0]->data;    mapping m;    if (mixed err = catch( m = decode_value( q[0]->meta ) ))    report_debug ("Failed to decode meta mapping for id %O in %s: %s",    id, name, describe_error (err));    if( !m ) return 0;    -  +  rid->cache_status["icachedisk"] = 1;    m = Roxen.http_string_answer( f, m->type||("image/gif") );       if( strlen( f ) > 6000 )    return m;    rst_cache[ id ] = m;    if( sizeof( rst_cache ) > 100 )    rst_cache = ([ id : m ]);    return rst_cache[ id ] + ([]);    }    // Case 2: We have cache entry, but no data.