Branch: Tag:

2009-11-24

2009-11-24 15:17:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Most graphics tags now support timeouts for the argument cache.

Rev: server/modules/graphics/atlas.pike:1.19
Rev: server/modules/graphics/business.pike:1.154
Rev: server/modules/graphics/cimg.pike:1.83
Rev: server/modules/graphics/gbutton.pike:1.120
Rev: server/modules/graphics/graphic_text.pike:1.308
Rev: server/modules/graphics/gxml.pike:1.47

27:   // must also be aligned left or right.       - constant cvs_version = "$Id: gbutton.pike,v 1.119 2009/05/07 14:15:54 mast Exp $"; + constant cvs_version = "$Id: gbutton.pike,v 1.120 2009/11/24 15:17:33 grubba Exp $";   constant thread_safe = 1;      #include <module.h>
853:    m_delete(args, "extra-mask-layers");    m_delete(args, "extra-frame-layers");    +  int timeout = UNDEFINED; +  if (args["unix-time"]) { +  timeout = (int)args["unix-time"] - time(1); +  } +  timeout = Roxen.time_dequantifier(args, timeout); +  if (!zero_type(timeout)) { +  // Clean up the args mapping. +  foreach(({ "unix-time", "seconds", "minutes", "beats", "hours", +  "days", "weeks", "months", "years" }), string arg) { +  m_delete(args, arg); +  } +  // Make sure the timeout is positive (and reasonable). +  if (timeout < 60) timeout = 60; +  } +     if( fi ) {    new_args->stat = get_file_stat( fi, id );   #if constant(Sitebuilder)
885:   // t = gethrtime();    string img_src =    query_absolute_internal_location(id) + -  button_cache->store( ({ new_args, (string)content }), id); +  button_cache->store( ({ new_args, (string)content }), id, timeout);       if(do_ext)    img_src += "." + (new_args->format || "gif");