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.927 2006/06/01 11:25:40 wellhard Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.928 2006/08/21 11:56:38 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:3281: 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,UNIX_TIMESTAMP(),%s,%s)", +  " (id,size,atime,meta,data) VALUES" +  " (%s,%d,UNIX_TIMESTAMP(),_binary%s,_binary%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:3639:    }       void set_draw_function( function to )    //! Set a new draw function.    {    draw_function = to;    }       static void setup_tables()    { -  if(catch(QUERY("SELECT DATA FROM "+name+" WHERE id=''"))) +  if(catch(QUERY("SELECT data FROM "+name+" WHERE id=''")))    {    werror("Creating image-cache tables for '"+name+"'\n");    catch(QUERY("DROP TABLE "+name));       // The old tables. This is only useful for people who have run    // Roxen 2.2 from cvs before    catch(QUERY("DROP TABLE "+name+"_data"));          master()->resolv("DBManager.is_module_table")
Roxen.git/server/base_server/roxen.pike:3815:    "id: %O, old data: %O, new data: %O\n",    id, row->contents, encoded_args);    error("ArgCache.create_key() Duplicate key found!\n");    }       if(sizeof(rows))    return;       QUERY( "INSERT INTO "+name+"2 "    "(id, contents, ctime, atime) VALUES " -  "(%s, %s, NOW(), NOW())", id, encoded_args ); +  "(%s, _binary%s, NOW(), NOW())", id, encoded_args );       dwerror("ArgCache: Create new key %O\n", id);       (plugins->create_key-({0}))( id, encoded_args );    }       static array plugins;    static void get_plugins()    {    plugins = ({});
Roxen.git/server/base_server/roxen.pike:4088:       foreach( data, mapping m )    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 ); +  "(_binary%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;