Roxen.git/
server/
modules/
tags/
rxmltags.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2001-02-10
2001-02-10 22:02:04 by Martin Nilsson <mani@lysator.liu.se>
4c38647b897056ea8bc870f6468bdd9db799c2f2 (
44
lines) (+
26
/-
18
)
[
Show
|
Annotate
]
Branch:
5.2
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;