You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Dietz, Phil E." <PE...@West.com> on 2002/11/08 19:51:55 UTC

RFC on cgi-error hook

I want to add a new hook to apache2.

It's called the "cgi-stderr" hook.

If a CGI script emits anything on stderr, trap it into a bucket and let all modules who want to look at the stderr bucket, do so.

This can be used to:
	escalate scripting errors, 
	throttle apache to the problematic site, 
	show special error documents, 
	integrate cgi development into IDEs, 
	etc.

It would also let 3rd party vendors catch apache cgi-errors into their tool...such as a mod_unicenter.c, etc.

(imagine that your database goes down, so the CGI sends a special message back on stderr.  Apaches mod_throttle module sees that message and throttles access to the site).

Now my question...

Using mod_cgi is optional...so would it make sense to add a "cgi-stderr" hook to the server/core.c ?
I'd like to use the hook mechanism so any 3rd party module could react upon it.

I guess this "cgi-stderr" hook could also be called a "stderr_filter" to go with the input_filter and output_filter hooks already available.

Phil


RE: RFC on cgi-error hook

Posted by "John K. Sterling" <jo...@sterls.com>.
you would not want to modify the core for this.  You would want to use optional
functions and add an optional function to mod_cgi to register for it.  Then
have mod_cgi notify all registered methods of any stderr data.

sterling

>-- Original Message --
>Reply-To: dev@httpd.apache.org
>Subject: RFC on cgi-error hook
>Date: Fri, 8 Nov 2002 12:51:55 -0600
>From: "Dietz, Phil E." <PE...@West.com>
>To: <de...@httpd.apache.org>
>
>
>I want to add a new hook to apache2.
>
>It's called the "cgi-stderr" hook.
>
>If a CGI script emits anything on stderr, trap it into a bucket and let
all
>modules who want to look at the stderr bucket, do so.
>
>This can be used to:
>	escalate scripting errors, 
>	throttle apache to the problematic site, 
>	show special error documents, 
>	integrate cgi development into IDEs, 
>	etc.
>
>It would also let 3rd party vendors catch apache cgi-errors into their
tool...such
>as a mod_unicenter.c, etc.
>
>(imagine that your database goes down, so the CGI sends a special message
>back on stderr.  Apaches mod_throttle module sees that message and throttles
>access to the site).
>
>Now my question...
>
>Using mod_cgi is optional...so would it make sense to add a "cgi-stderr"
>hook to the server/core.c ?
>I'd like to use the hook mechanism so any 3rd party module could react
upon
>it.
>
>I guess this "cgi-stderr" hook could also be called a "stderr_filter" to
>go with the input_filter and output_filter hooks already available.
>
>Phil
>