You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Stein <gs...@lyra.org> on 2000/06/24 10:24:12 UTC

[PATCH] filter common/support patch #2

This patch is extracted from Ryan's patches. It adds a new processing step
that provides a point where modules should insert their filters.


Index: include/http_request.h
===================================================================
RCS file: /home/cvs/apache-2.0/src/include/http_request.h,v
retrieving revision 1.11
diff -u -r1.11 http_request.h
--- include/http_request.h	2000/05/27 22:53:47	1.11
+++ include/http_request.h	2000/06/24 08:19:45
@@ -120,6 +120,7 @@
 AP_DECLARE_HOOK(int,type_checker,(request_rec *))
 AP_DECLARE_HOOK(int,access_checker,(request_rec *))
 AP_DECLARE_HOOK(int,auth_checker,(request_rec *))
+AP_DECLARE_HOOK(void,insert_filter,(request_rec *))
 
 #ifdef __cplusplus
 }
Index: main/http_request.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v
retrieving revision 1.33
diff -u -r1.33 http_request.c
--- main/http_request.c	2000/06/17 16:29:48	1.33
+++ main/http_request.c	2000/06/24 08:19:50
@@ -86,6 +86,7 @@
 	    AP_HOOK_LINK(type_checker)
 	    AP_HOOK_LINK(access_checker)
 	    AP_HOOK_LINK(auth_checker)
+	    AP_HOOK_LINK(insert_filter)
 )
 
 AP_IMPLEMENT_HOOK_RUN_FIRST(int,translate_name,
@@ -100,6 +101,7 @@
                           (request_rec *r),(r),OK,DECLINED)
 AP_IMPLEMENT_HOOK_RUN_FIRST(int,auth_checker,
                             (request_rec *r),(r),DECLINED)
+AP_IMPLEMENT_HOOK_VOID(insert_filter, (request_rec *r), (r))
 
 /*****************************************************************
  *
@@ -1246,6 +1248,15 @@
         ap_die(access_status, r);
         return;
     }
+
+    /* The new insert_filter stage makes sense here IMHO.  We are sure that
+     * we are going to run the request now, so we may as well insert filters
+     * if any are available.  Since the goal of this phase is to allow all
+     * modules to insert a filter if they want to, this filter returns
+     * void.  I just can't see any way that this filter can reasonably
+     * fail, either your modules inserts something or it doesn't.  rbb
+     */
+    ap_run_insert_filter(r);
 
     if ((access_status = ap_invoke_handler(r)) != 0) {
         ap_die(access_status, r);

Re: [PATCH] filter common/support patch #2

Posted by rb...@covalent.net.
+1.

Ryan

On Sat, 24 Jun 2000, Greg Stein wrote:

> This patch is extracted from Ryan's patches. It adds a new processing step
> that provides a point where modules should insert their filters.
> 
> 
> Index: include/http_request.h
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/include/http_request.h,v
> retrieving revision 1.11
> diff -u -r1.11 http_request.h
> --- include/http_request.h	2000/05/27 22:53:47	1.11
> +++ include/http_request.h	2000/06/24 08:19:45
> @@ -120,6 +120,7 @@
>  AP_DECLARE_HOOK(int,type_checker,(request_rec *))
>  AP_DECLARE_HOOK(int,access_checker,(request_rec *))
>  AP_DECLARE_HOOK(int,auth_checker,(request_rec *))
> +AP_DECLARE_HOOK(void,insert_filter,(request_rec *))
>  
>  #ifdef __cplusplus
>  }
> Index: main/http_request.c
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/main/http_request.c,v
> retrieving revision 1.33
> diff -u -r1.33 http_request.c
> --- main/http_request.c	2000/06/17 16:29:48	1.33
> +++ main/http_request.c	2000/06/24 08:19:50
> @@ -86,6 +86,7 @@
>  	    AP_HOOK_LINK(type_checker)
>  	    AP_HOOK_LINK(access_checker)
>  	    AP_HOOK_LINK(auth_checker)
> +	    AP_HOOK_LINK(insert_filter)
>  )
>  
>  AP_IMPLEMENT_HOOK_RUN_FIRST(int,translate_name,
> @@ -100,6 +101,7 @@
>                            (request_rec *r),(r),OK,DECLINED)
>  AP_IMPLEMENT_HOOK_RUN_FIRST(int,auth_checker,
>                              (request_rec *r),(r),DECLINED)
> +AP_IMPLEMENT_HOOK_VOID(insert_filter, (request_rec *r), (r))
>  
>  /*****************************************************************
>   *
> @@ -1246,6 +1248,15 @@
>          ap_die(access_status, r);
>          return;
>      }
> +
> +    /* The new insert_filter stage makes sense here IMHO.  We are sure that
> +     * we are going to run the request now, so we may as well insert filters
> +     * if any are available.  Since the goal of this phase is to allow all
> +     * modules to insert a filter if they want to, this filter returns
> +     * void.  I just can't see any way that this filter can reasonably
> +     * fail, either your modules inserts something or it doesn't.  rbb
> +     */
> +    ap_run_insert_filter(r);
>  
>      if ((access_status = ap_invoke_handler(r)) != 0) {
>          ap_die(access_status, r);
> 


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------