- Publicity: Public Only All
filter-procs.tcl
Procs intended for use as NaviServer/OpenACS request filters. This file contains reusable filters for rejecting unwanted requests and protecting the normal connection pool from excessive anonymous traffic. The filters can be parameterized when registered for particular HTTP methods and URL patterns.
- Location:
- packages/acs-tcl/tcl/filter-procs.tcl
Procedures in this file
- util::reject_anonymous_on_high_load_filter (public)
- util::reject_request_filter (public)
Detailed information
util::reject_anonymous_on_high_load_filter (public)
util::reject_anonymous_on_high_load_filter why [ args... ]
Reject an anonymous request when too many requests for the same URL are already running or when the server request queue exceeds a configured limit. The filter is active only in the connection pools specified by -pools. The empty pool name denotes the default connection pool. Example:
ns_register_filter postauth GET /bugtracker/* ::util::reject_anonymous_on_high_load_filter -what "bugtracker request" -pools [list ""] -max_running 3 -max_queued 10 -retry_after 60
- Parameters:
- why (required)
- filter stage, normally postauth
- Returns:
- filter_ok or filter_return
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
util::reject_request_filter (public)
util::reject_request_filter why what
Reject a request from a NaviServer filter. This proc is intended for use with ns_register_filter, in particular for early preauth filters that reject unwanted probe, scanner, or otherwise unsupported request paths before the OpenACS request processor performs canonical-host redirects or page dispatch. When used as a preauth filter, the proc performs the minimal ad_conn setup needed by the OpenACS request processor cleanup path. Example:
ns_register_filter -first preauth POST /PSEMHUB/* ::util::reject_request_filter "PeopleSoft probe"
- Parameters:
- why (required)
- filter stage, e.g. preauth
- what (required)
- short description of the rejected request
- Returns:
- filter_return
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.