f41b98 | 2009-05-07 | Martin Stjernholm | |
|
d69ba5 | 2001-09-03 | Martin Nilsson | |
|
83735f | 2000-07-20 | Johan Sundström | | inherit "module";
|
0917d3 | 2013-03-04 | Anders Johansson | | constant cvs_version = "$Id$";
|
83735f | 2000-07-20 | Johan Sundström | | constant module_type = MODULE_FILTER;
constant module_name = "RefDoc for MODULE_FILTER";
constant module_doc = "This module does nothing, but its inlined "
"documentation gets imported into the roxen "
"programmer manual. You hardly want to add "
"this module to your virtual servers.";
mapping last_seen;
int handled;
int seen;
mapping|void filter(mapping|void result, RequestID id)
|
cd202d | 2001-08-31 | Henrik Grubbström (Grubba) | |
|
83735f | 2000-07-20 | Johan Sundström | |
{
seen++;
last_seen = result;
|
915856 | 2008-12-17 | Jonas Wallden | | string|array(string) type = result->type;
if (arrayp(type))
type = type[0];
|
83735f | 2000-07-20 | Johan Sundström | | if(!result
|| !stringp(result->data)
|| !id->prestate->filterpass
|
915856 | 2008-12-17 | Jonas Wallden | | || !glob("text/*", type)
|
83735f | 2000-07-20 | Johan Sundström | | )
return 0;
handled++;
result->data = sprintf("%O", result);
result->type = "text/plain";
return result;
}
string status()
{
return sprintf("Received <b>%d</b> requests, of which <b>%d</b> were "
"touched by the module. Last seen request's result "
"mapping: <pre>%s</pre>",
seen, handled, Roxen.html_encode_string(sprintf("%O", last_seen)));
}
|