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 - 2001, 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.859 2004/02/03 12:04:28 anders Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.860 2004/02/05 15:32:20 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:2895: Inside #if defined(ARG_CACHE_DEBUG)
   if(!stringp(data)) return;   #ifdef ARG_CACHE_DEBUG    werror("store %O (%d bytes)\n", id, strlen(data) );   #endif    meta_cache_insert( id, meta );    string meta_data = encode_value( meta );   #ifdef ARG_CACHE_DEBUG    werror("Replacing entry for %O\n", id );   #endif    QUERY("REPLACE INTO "+name+ -  " (id,size,atime,meta,data) VALUES (%s,%d,%d,%s,%s)", -  id, strlen(data)+strlen(meta_data), time(1), meta_data, data ); +  " (id,size,atime,meta,data) VALUES (%s,%d,UNIX_TIMESTAMP(),%s,%s)", +  id, strlen(data)+strlen(meta_data), meta_data, data );    }       static mapping restore_meta( string id, RequestID rid )    {    if( meta_cache[ id ] )    {    meta_cache[ id ][ 1 ] = time(1); // Update cached atime.    return meta_cache[ id ][ 0 ];    }   
Roxen.git/server/base_server/roxen.pike:3214:    error("Expected mapping as the first element of the argument array\n");    update_args( data[0] );    ci = map( map( data, tomapp ), argcache->store )*"$";    } else    ci = data;    update_args = 0; // To avoid garbage.       if( zero_type( uid_cache[ ci ] ) )    {    uid_cache[ci] = user; -  QUERY("REPLACE INTO "+name+" (id,uid,atime) VALUES (%s,%s,%d)", -  ci, user||"", time(1) ); +  if( catch(QUERY( "UPDATE "+name+" SET uid=%s WHERE id=%s", +  user||"", ci )) ) +  QUERY("INSERT INTO "+name+" " +  "(id,uid,atime) VALUES (%s,%s,UNIX_TIMESTAMP())", +  ci, user||""); +     }      #ifndef NO_ARG_CACHE_SB_REPLICATE    if(id->misc->persistent_cache_crawler) {    // Force an update of atime for the requested arg cache id.    foreach(ci/"$", string key) {   #if REPLICATE_DEBUG    werror("Request for id %O from prefetch crawler.\n", key);   #endif /* REPLICATE_DEBUG */    argcache->refresh_arg(key);