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.830 2003/04/05 22:15:36 anders Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.831 2003/04/14 16:29:59 wellhard 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:3396:    if( m->contents == long_key )    return (int)m->id;       if(zero_type(index_id))    index_id = -1;       string index_id_value = (index_id == -1? "NULL": index_id);    QUERY( "INSERT INTO "+name+" (contents,md5,atime,index_id) VALUES "    "(%s,%s,UNIX_TIMESTAMP(),"+index_id_value+")", long_key, md );    int id = (int)db->master_sql->insert_id(); +  if(!id) +  error("ArgCache::create_key() insert_id returned 0.\n");   #ifdef REPLICATE_DEBUG    werror("Create new local key: id: %d, index_id: %d.\n", id, index_id);   #endif       (plugins->create_key-({0}))( id, long_key );       return id;    }       static int low_key_exists( string key )
Roxen.git/server/base_server/roxen.pike:3573:    mixed data = decode_value(q);    string hl = Crypto.md5()->update( q )->digest();    cache[ hl ] = id;    cache[ id ] = data;    return data;    }       void delete( string id )    //! Remove the data element stored under the key 'id'.    { +  LOCK();    (plugins->delete-({0}))( id );    m_delete( cache, id );       foreach( decode_id( id ), int id )    {    (plugins->low_delete-({0}))( id );    if(cache[id])    {    m_delete( cache, cache[id] );    m_delete( cache, id );
Roxen.git/server/base_server/roxen.pike:3668:    if(s != "EOF")    return "Missing data in argcache file\n";    return 0;    }       void refresh_arg(string id)    {    array i = decode_id( id );    if( !i )    error("Requesting unknown key\n"); +  LOCK();    QUERY("UPDATE "+name+" SET atime='"+time(1)+"' WHERE id="+i[0]);    QUERY("UPDATE "+name+" SET atime='"+time(1)+"' WHERE id="+i[1]);    }   }      mapping cached_decoders = ([]);   string decode_charset( string charset, string data )   {    // FIXME: This code is probably not thread-safe!    if( charset == "iso-8859-1" ) return data;