d69ba5 | 2001-09-03 | Martin Nilsson | |
|
83735f | 2000-07-20 | Johan Sundström | | inherit "module";
|
d69ba5 | 2001-09-03 | Martin Nilsson | | constant cvs_version = "$Id: filter.pike,v 1.3 2001/09/03 18:05:10 nilsson Exp $";
|
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;
if(!result
|| !stringp(result->data)
|| !id->prestate->filterpass
|| !glob("text/*", result->type)
)
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)));
}
|