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.904 2006/11/23 14:02:30 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.905 2007/03/15 16:46:24 anders 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:3112: Inside #if defined(ARG_CACHE_DEBUG)
   if (q[0]->data != data) {    werror("Data differs: %O != %O\n",    data, q[0]->data);    }    }   #endif    }       static mapping restore_meta( string id, RequestID rid )    { -  if( meta_cache[ id ] ) +  if( array item = meta_cache[ id ] )    { -  meta_cache[ id ][ 1 ] = time(1); // Update cached atime. -  return meta_cache[ id ][ 0 ]; +  item[ 1 ] = time(1); // Update cached atime. +  return item[ 0 ];    }      #ifdef ARG_CACHE_DEBUG    werror("restore meta %O\n", id );   #endif    array(mapping(string:string)) q =    QUERY("SELECT meta FROM "+name+" WHERE id=%s", id );       string s;    if(!sizeof(q) || !strlen(s = q[0]->meta))
Roxen.git/server/base_server/roxen.pike:3143:    return 0;    }       QUERY("UPDATE "+name+" SET atime=UNIX_TIMESTAMP() WHERE id=%s",id );    return meta_cache_insert( id, m );    }       static void sync_meta()    {    // Sync cached atimes. -  foreach(indices(meta_cache), string id) { -  if (meta_cache[id][1]) +  foreach(meta_cache; string id; array value) { +  if (value[1])    QUERY("UPDATE "+name+" SET atime=%d WHERE id=%s", -  meta_cache[id][1], id); +  value[1], id);    }    meta_cache = ([]);    }       void flush(int|void age)    //! Flush the cache. If an age (an integer as returned by    //! @[time()]) is provided, only images with their latest access before    //! that time are flushed.    {    int num;
Roxen.git/server/base_server/roxen.pike:3336:    werror("data %O\n", na );   #endif    if(! (res=restore( na,id )) )    {    mixed err;    if (nodraw || (err = catch {    if (mapping res = draw( na, id ))    return res;    })) {    // File not found. -  if(arrayp(err) && sizeof(err) && stringp(err[0]) && -  sscanf(err[0], "Requesting unknown key %s\n", string message) == 1) +  +  if(arrayp(err) && sizeof(err) && stringp(err[0]))    { -  +  if (sscanf(err[0], "Requesting unknown key %s\n", +  string message) == 1) +  {    report_debug("Requesting unknown key %s %O from %O\n",    message,    id->not_query,    (sizeof(id->referer)?id->referer[0]:"unknown page")); -  +  return 0;    } -  else +  if (sscanf(err[0], "Failed to load specified image [\"%s\"]\n", +  string message) == 1) +  { +  report_debug("Failed to load specified image %O from %O - referrer %O\n", +  message, +  id->not_query, +  (sizeof(id->referer)?id->referer[0]:"unknown page")); +  return 0; +  } +  }    report_debug("Error in draw: %s\n", describe_backtrace(err));    return 0;    }    if( !(res = restore( na,id )) ) {    error("Draw callback %O did not generate any data.\n"    "na: %O\n"    "id: %O\n",    draw_function, na, id);    }    }