Branch: Tag:

2009-11-26

2009-11-26 15:43:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Backported support for ArgCache timeouts from Roxen 5.0. Fixes [bug 4548 (#4548)].

Rev: server/base_server/roxen.pike:1.966
Rev: server/modules/graphics/atlas.pike:1.18
Rev: server/modules/graphics/business.pike:1.152
Rev: server/modules/graphics/cimg.pike:1.80
Rev: server/modules/graphics/gbutton.pike:1.116
Rev: server/modules/graphics/graphic_text.pike:1.305
Rev: server/modules/graphics/gxml.pike:1.39

7:      roxen.ImageCache the_cache;    - constant cvs_version = "$Id: cimg.pike,v 1.79 2009/07/08 09:31:52 anders Exp $"; + constant cvs_version = "$Id: cimg.pike,v 1.80 2009/11/26 15:43:48 grubba Exp $";   constant module_type = MODULE_TAG;   constant module_name = "Graphics: Image converter";   constant module_doc = "Provides the tag <tt>&lt;cimg&gt;</tt> that can be used "
100: Inside #if defined(manual)
  </attr>",      "emit#cimg":({ #"<desc type='plugin'><p><short> -  Entitybased version of <xref href='../graphics/cimg.tag' />.</short> +  Entity based version of <xref href='../graphics/cimg.tag' />.</short>    Takes the same attributes as <tag>cimg</tag>.</p>   </desc>   
380:    mapping res = ([ ]);    mapping a = get_my_args( check_args( args ), id );    string data; +  +  int timeout = Roxen.timeout_dequantifier(args); +     mixed err = catch // This code will fail if the image does not exist.    {    // Store misc->cacheable since the image cache can raise it and
389: Inside #if defined(DEBUG_CACHEABLE)
  #ifdef DEBUG_CACHEABLE    report_debug("%s:%d saved cacheable flags\n", __FILE__, __LINE__);   #endif -  res->src=(query_absolute_internal_location(id)+the_cache->store( a,id )); +  res->src=(query_absolute_internal_location(id)+ +  the_cache->store( a, id, timeout ));    if(args->filename && sizeof(args->filename))    res->src += "/" + Roxen.http_encode_url(args->filename);    if(do_ext)
428:       array do_return(RequestID id)    { +  int timeout = Roxen.timeout_dequantifier(args);    mapping a = get_my_args( check_args( args ), id );    args -= a;    string ext = "";
437:    if(do_ext)    ext = "." + a->format;    args->src = query_absolute_internal_location( id ) -  + the_cache->store( a, id ) + filename + ext; +  + the_cache->store( a, id, timeout ) + filename + ext;    int no_draw = !id->misc->generate_images;    if( mapping size = the_cache->metadata( a, id, no_draw ) )    {
464:       array do_return(RequestID id)    { +  int timeout = Roxen.timeout_dequantifier(args);    string filename = "";    mapping a = get_my_args (check_args (args), id);       if(args->filename && sizeof(args->filename))    filename = "/" + Roxen.http_encode_url(args->filename);    result = query_absolute_internal_location(id) -  + the_cache->store(a, id) +  + the_cache->store(a, id, timeout)    + filename    + (do_ext ? "." + a->format : "");    return 0;    }    }   }