Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:3962:    if( !meta || !data )    error("Invalid reply mapping.\n"    "Expected ([ \"meta\": ([metadata]), \"data\":\"data\" ])\n"    "Got %O\n", reply);    }   #ifdef ARG_CACHE_DEBUG    werror("draw %O done\n", name );   #endif    // Avoid throwing and error if the same image is rendered twice.    mixed err = catch(store_data( name, data, meta )); +  if (objectp (err) && err->is_RXML_Backtrace && RXML_CONTEXT) { +  throw (err); +  }   #ifdef ARG_CACHE_DEBUG    if (err) {    werror("store_data failed with:\n"    "%s\n", describe_backtrace(err));    }   #endif    }       protected void store_data( string id, string data, mapping meta )    {    if(!stringp(data)) return;   #ifdef ARG_CACHE_DEBUG    werror("store %O (%d bytes)\n", id, strlen(data) );   #endif -  +  // Since 134217728 (2^27) is the largest number we can give as argument to +  // the SQL-function "SPACE()", we cannot store images larger than 2^27 bytes +  // even though the size of the data-column allows 4294967295 bytes. +  if (sizeof(data) > 134217728) { // 134217728 = 2^27 +  RXML.run_error("Generated image data (%f MB) exceeds max limit of " +  "128 MB.\n", (float) sizeof(data) / 1024 / 1024 ); +  }    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()," MYSQL__BINARY "%s," MYSQL__BINARY "%s)",    id, strlen(data)+strlen(meta_data), meta_data, data );   #ifdef ARG_CACHE_DEBUG
Roxen.git/server/base_server/roxen.pike:4253:    {    mixed err;    if (nodraw || (err = catch {    if (mapping res = draw( na, id ))    return res;    })) {   #ifdef ARG_CACHE_DEBUG    werror("draw() failed with error: %s\n",    describe_backtrace(err));   #endif -  if (objectp (err) && err->is_RXML_Backtrace && !RXML_CONTEXT) { +  if (objectp (err) && err->is_RXML_Backtrace) { +  if (RXML_CONTEXT) { + #ifdef ARG_CACHE_DEBUG +  werror("Rethrowing error...\n"); + #endif +  throw (err); +  }    // If we get an rxml error and there's no rxml context then    // we're called from a direct request to the image cache.    // The error ought to have been reported in the page that    // generated the link to the image cache, but since it's too    // late for that now, we just log it as a (brief) server    // error with the referring page.    string errmsg = "Error in " + name + " image generation: " +    err->msg;    if (sizeof (id->referer))    errmsg += " Referrer: " + id->referer[0];