Branch: Tag:

2001-02-10

2001-02-10 22:02:04 by Martin Nilsson <mani@lysator.liu.se>

Newstyled <cache>

Rev: server/modules/tags/rxmltags.pike:1.201

7:   #define _rettext id->misc->defines[" _rettext"]   #define _ok id->misc->defines[" _ok"]    - constant cvs_version = "$Id: rxmltags.pike,v 1.200 2001/02/06 22:41:21 nilsson Exp $"; + constant cvs_version = "$Id: rxmltags.pike,v 1.201 2001/02/10 22:02:04 nilsson Exp $";   constant thread_safe = 1;   constant language = roxen->language;   
1181:    return ({r});   }    - string container_cache(string tag, mapping args, -  string contents, RequestID id) - { + class TagCache { +  inherit RXML.Tag; +  constant name = "cache"; +  RXML.Type content_type = RXML.t_same; +  +  class Frame { +  inherit RXML.Frame; +  array do_return(RequestID id) {   #define HASH(x) (x+id->not_query+id->query+id->realauth+id->conf->query("MyWorldLocation"))    string key="";    if(!args->nohash) {    object md5 = Crypto.md5(); -  md5->update(HASH(contents)); +  md5->update(HASH(content));    key=md5->digest();    }    if(args->key)    key += args->key; -  string parsed = cache_lookup("tag_cache", key); -  if(!parsed) { -  parsed = Roxen.parse_rxml(contents, id); -  cache_set("tag_cache", key, parsed, Roxen.time_dequantifier(args)); +  result = cache_lookup("tag_cache", key); +  if(!result) { +  result = Roxen.parse_rxml(content, id); +  cache_set("tag_cache", key, result, Roxen.time_dequantifier(args));    } -  return parsed; +    #undef HASH -  +  return 0;    } -  +  } + }      class TagCrypt {    inherit RXML.Tag;