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.946 2006/11/14 15:18:49 anders Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.947 2006/11/16 13:08:15 mast 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:3833:    static void create( string _name )    {    name = _name;    init_db();    // Support that the 'local' database moves (not really nessesary,    // but it won't hurt either)    master()->resolv( "DBManager.add_dblist_changed_callback" )( init_db );    get_plugins();    }    -  string read_encoded_args( string id ) +  string read_encoded_args( string id, void|int dont_update_atime)    {    LOCK();    array res = QUERY("SELECT contents FROM "+name+"2 "    " WHERE id = %s", id);    if(!sizeof(res))    return 0; -  +  if (!dont_update_atime)    QUERY("UPDATE "+name+"2 "    " SET atime = NOW() "    " WHERE id = %s", id);    return res[0]->contents;    }       void create_key( string id, string encoded_args )    {    LOCK();    array(mapping) rows =
Roxen.git/server/base_server/roxen.pike:3976:    (array(string))    QUERY( "SELECT id from "+name+"2 "    " LIMIT %d, %d", cursor, FETCH_ROWS)->id;       cursor += FETCH_ROWS;       foreach(ids, string id) {    dwerror("ArgCache.write_dump(): %O\n", id);       string s = -  MIME.encode_base64(encode_value(({ id, read_encoded_args(id) })), +  MIME.encode_base64(encode_value(({ id, read_encoded_args(id, 1) })),    1)+"\n";    if(sizeof(s) != file->write(s))    return 0;    }    } while(sizeof(ids) == FETCH_ROWS);    }    return file->write("EOF\n") == 4;    }       string read_dump (Stdio.FILE file)
Roxen.git/server/base_server/roxen.pike:4101:    static void create( string _name )    {    name = _name;    init_db();    // Support that the 'local' database moves (not really nessesary,    // but it won't hurt either)    master()->resolv( "DBManager.add_dblist_changed_callback" )( init_db );    get_plugins();    }    -  string read_args( int id ) +  string read_args( int id, void|int dont_update_atime)    {    LOCK();    array res = QUERY("SELECT contents FROM "+name+" WHERE id="+id);    if( sizeof(res) )    { -  +  if (!dont_update_atime)    QUERY("UPDATE "+name+" SET atime='"+time(1)+"' WHERE id="+id);    return res[0]->contents;    }    return 0;    }       int read_index_id( int id )    {    LOCK();    array res = QUERY("SELECT index_id FROM "+name+" WHERE id="+id);
Roxen.git/server/base_server/roxen.pike:4386:       cursor += FETCH_ROWS;       foreach(ids, int id) {    int index_id = read_index_id(id);   #ifdef REPLICATE_DEBUG    werror("write_dump: argcache id: %d, index_id: %d.\n", id, index_id);   #endif       string s = -  MIME.encode_base64(encode_value(({ id, read_args(id), -  index_id, read_args(index_id) })), +  MIME.encode_base64(encode_value(({ id, read_args(id, 1), +  index_id, +  read_args(index_id, 1) })),    1)+"\n";    if(sizeof(s) != file->write(s))    return 0;    }    } while(sizeof(ids) == FETCH_ROWS);    }    return file->write("EOF\n") == 4;    }       static void create_remote_key(int id, string key,