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 - 2001, 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.874 2004/05/25 15:52:17 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.875 2004/06/11 15:34:35 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:2452:    werror("draw %O\n", name );   #endif    mixed args = Array.map( Array.map( name/"$", argcache->lookup,    id->client ), frommapp);       mapping meta;    string data;    array guides;    mixed reply = draw_function( @copy_value(args), id );    -  if( !reply ) +  if( !reply ) { + #ifdef ARG_CACHE_DEBUG +  werror("%O(%{%O, %}%O) ==> 0\n", +  draw_function, args, id); + #endif    return; -  +  }       if( arrayp( args ) )    args = args[0];       if( arrayp( reply ) ) // layers.    {    guides = reply->get_misc_value( "image_guides" )-({});    if( sizeof( guides ) )    guides = guides[0];    reply = Image.lay( reply );
Roxen.git/server/base_server/roxen.pike:2942:    data = reply->data;    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. -  catch(store_data( name, data, meta )); +  mixed err = catch(store_data( name, data, meta )); + #ifdef ARG_CACHE_DEBUG +  if (err) { +  werror("store_data failed with:\n" +  "%s\n", describe_backtrace(err));    } -  + #endif +  return reply; +  }       static 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    meta_cache_insert( id, meta );    string meta_data = encode_value( meta );   #ifdef ARG_CACHE_DEBUG
Roxen.git/server/base_server/roxen.pike:3194:    {    report_debug("Requesting unknown key %s %O from %O\n",    message,    id->not_query,    (sizeof(id->referer)?id->referer[0]:"unknown page"));    }    else    report_debug("Error in draw: %s\n", describe_backtrace(err));    return 0;    } -  if( !(res = restore( na,id )) ) -  error("Draw callback did not generate any data\n"); +  if( !(res = restore( na,id )) ) { +  error("Draw callback %O did not generate any data.\n" +  "na: %O\n" +  "id: %O\n", +  draw_function, na, id);    } -  +  }    res->stat = ({ 0, 0, 0, 900000000, 0, 0, 0, 0, 0 });       // Setting the cacheable flag is done in order to get headers sent which    // cause the image to be cached in the client even when using https    // sessions. However, this flag also controls whether the file should    // be placed in the protocol-level cache, so we'll counter by setting a    // separate flag.    RAISE_CACHE(INITIAL_CACHEABLE);    NO_PROTO_CACHE();    return res;