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.886 2005/01/17 14:54:20 jonasw Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.887 2005/02/01 12:37:47 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:3796:    (plugins->low_delete-({0}))( id );    if(cache[id])    {    m_delete( cache, cache[id] );    m_delete( cache, id );    }    QUERY( "DELETE FROM "+name+" WHERE id="+id );    }    }    + #define SECRET_TAG "££" +     int write_dump(Stdio.File file, int|void from_time)    // Write a mapping from id to encoded arg string for all local arg    // entries created after from_time to a file. Returns 0 if faled, 1    // otherwise.    {    constant FETCH_ROWS = 10000;    -  if(sizeof(secret+"\n") != file->write(secret+"\n")) +  string encoded_secret = SECRET_TAG+MIME.encode_base64(secret, 1)+"\n"; +  if(sizeof(encoded_secret) != file->write(encoded_secret))    return 0;       // The server does only need to use file based argcache    // replication if the server don't participate in a replicate    // setup with a shared database.    if( !has_value((plugins->is_functional-({0}))(), 1) )    {    int cursor;    array(int) ids;    do {
Roxen.git/server/base_server/roxen.pike:3860:    int index_id, string index_key,    string server)    {    (plugins->create_remote_key-({0}))( id, key, index_id, index_key, server );    }       string read_dump (Stdio.FILE file)    // Returns an error message if there was a parse error, 0 otherwise.    {    string secret = file->gets(); +  // Note, old replication dumps can contain unencoded server secrets. +  if(secret && has_prefix(secret, SECRET_TAG)) +  secret = MIME.decode_base64(secret[sizeof(SECRET_TAG)..]); +     if(!secret || !sizeof(secret))    return "Server secret is missing\n";       string s;    while(s = file->gets())    {    if(s == "EOF")    return 0;    array a;    if(catch {