|
|
inherit "module"; |
|
|
constant cvs_version = "$Id: filter.pike,v 1.3 2001/09/03 18:05:10 nilsson Exp $"; |
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) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
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))); |
} |
|
|