Roxen.git/
server/
etc/
modules/
Roxen.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2005-12-05
2005-12-05 14:29:44 by Henrik Grubbström (Grubba) <grubba@grubba.org>
25c6d0016e95d8b25e44b292a471c825dc2f4a3f (
14
lines) (+
13
/-
1
)
[
Show
|
Annotate
]
Branch:
5.2
Added get_cookie_callback().
Rev: server/etc/modules/Roxen.pmod:1.198
1:
// This is a roxen pike module. Copyright © 1999 - 2004, Roxen IS. //
-
// $Id: Roxen.pmod,v 1.
197
2005/
11
/
29
16
:
39
:
16
grubba Exp $
+
// $Id: Roxen.pmod,v 1.
198
2005/
12
/
05
14
:
29
:
44
grubba Exp $
#include <roxen.h> #include <config.h>
130:
http_date (3600*24*365*2 + time (1)) + "; path=/"; }
+
static mapping(string:function(strimg, RequestID:string)) cookie_callbacks =
+
set_weak_flag(([]), Pike.WEAK_VALUES);
+
function(strimg, RequestID:string) get_cookie_callback(string cookie)
+
{
+
function(strimg, RequestID:string) cb = cookie_callbacks[cookie];
+
if (cb) return cb;
+
cb = lambda(string path, RequestID id) {
+
return id->cookies[cookie];
+
};
+
return cookie_callbacks[cookie] = cb;
+
}
// These five functions are questionable, but rather widely used. string msectos(int t)