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.929 2006/08/21 12:00:26 grubba Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.930 2006/08/21 15:41:48 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:2704: Inside #if undefined(__NT__)
   report_debug("**** %s: ABS exiting roxen!\n\n",    ctime(time()));    _exit(1); // It might now quit correctly otherwise, if it's    // locked up    });    int t = alarm (60*query("abs_timeout")+20);    // werror("alarm: %d seconds left, set to %d\n", t, 60*query("abs_timeout")+20);   }   #endif    + #if constant(ROXEN_MYSQL_SUPPORTS_UNICODE) + // NOTE: We need to mark binary data as binary in case + // the Mysql character_set_connection has been + // set to anything other than "latin1". + #define MYSQL__BINARY "_binary" + #else + #define MYSQL__BINARY "" + #endif +    function(string:Sql.Sql) dbm_cached_get;      class ImageCache   //! The image cache handles the behind-the-scenes caching and   //! regeneration features of graphics generated on the fly. Besides   //! being a cache, however, it serves a wide variety of other   //! interesting image conversion/manipulation functions as well.   {   #define QUERY(X,Y...) get_db()->query(X,Y)    string name;
Roxen.git/server/base_server/roxen.pike:3282: Inside #if defined(ARG_CACHE_DEBUG)
  #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(),_binary%s,_binary%s)", +  " (%s,%d,UNIX_TIMESTAMP()," MYSQL__BINARY "%s," MYSQL__BINARY "%s)",    id, strlen(data)+strlen(meta_data), meta_data, data );   #ifdef ARG_CACHE_DEBUG    array(mapping(string:string)) q =    QUERY("SELECT meta, data FROM " + name +    " WHERE id = %s", id);    if (!q || sizeof(q) != 1) {    werror("Unexpected result size: %d\n",    q && sizeof(q));    } else {    if (q[0]->meta != meta_data) {
Roxen.git/server/base_server/roxen.pike:3834:    "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, _binary%s, NOW(), NOW())", id, encoded_args ); +  "(%s, " MYSQL__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:4107:       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 " -  "(_binary%s,%s,UNIX_TIMESTAMP(),"+index_id_value+")", +  "(" MYSQL__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 );