Roxen.git/
server/
etc/
modules/
Roxen.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2000-11-21
2000-11-21 13:17:29 by Per Hedbor <ph@opera.com>
c9dd7f236e6d5453f415a13297654ca24f467f28 (
19
lines) (+
18
/-
1
)
[
Show
|
Annotate
]
Branch:
5.2
Abstraction
Rev: server/etc/modules/Roxen.pmod:1.51
Rev: server/modules/graphics/gbutton.pike:1.67
1:
/*
-
* $Id: Roxen.pmod,v 1.
50
2000/11/
16
11
:
52
:
15
per Exp $
+
* $Id: Roxen.pmod,v 1.
51
2000/11/
21
13
:
17
:
29
per Exp $
* * Various helper functions. *
1310:
set_cookie( id, name, value, -time(1), domain, path ); }
+
void add_cache_stat_callback( RequestID id, string file, int mtime )
+
{
+
while( id->misc->orig )
+
id = id->misc->orig;
+
if( !id->misc->_cachecallbacks ) return;
+
id->misc->_cachecallbacks += ({ lambda( RequestID id, object key ) {
+
Stat st = file_stat( file );
+
if( !st || (st[ST_MTIME] != mtime) )
+
{
+
destruct( key );
+
return 0;
+
}
+
return 1;
+
} });
+
}
+
void add_cache_callback( RequestID id,function(RequestID,object:int) callback ) //! The request id object is not yet fully initialized in this callback. //! The only valid fields are raw_url and request_headers.