You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by re...@apache.org on 2003/12/12 18:03:59 UTC

cvs commit: httpd-2.0/modules/metadata mod_expires.c

rederpj     2003/12/12 09:03:59

  Modified:    .        CHANGES
               include  http_protocol.h
               modules/http http_protocol.c
               modules/metadata mod_expires.c
  Log:
    *) Add a hook (insert_error_filter) to allow filters to re-insert
       themselves during processing of error responses. Enable mod_expires
       to use the new hook to include Expires headers in valid error
       responses. This addresses an RFC violation. It fixes PRs 19794,
       24884, and 25123. [Paul J. Reder]
  
  Revision  Changes    Path
  1.1341    +6 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1340
  retrieving revision 1.1341
  diff -u -r1.1340 -r1.1341
  --- CHANGES	11 Dec 2003 02:10:29 -0000	1.1340
  +++ CHANGES	12 Dec 2003 17:03:58 -0000	1.1341
  @@ -2,6 +2,12 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Add a hook (insert_error_filter) to allow filters to re-insert
  +     themselves during processing of error responses. Enable mod_expires
  +     to use the new hook to include Expires headers in valid error
  +     responses. This addresses an RFC violation. It fixes PRs 19794,
  +     24884, and 25123. [Paul J. Reder]
  +
     *) Fix <Limit> and <LimitExcept> parsing to require a closing '>' 
        in the initial container.  PR 25414. 
        [Geoffrey Young <geoff apache.org>]
  
  
  
  1.85      +7 -0      httpd-2.0/include/http_protocol.h
  
  Index: http_protocol.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_protocol.h,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- http_protocol.h	3 Feb 2003 17:52:53 -0000	1.84
  +++ http_protocol.h	12 Dec 2003 17:03:58 -0000	1.85
  @@ -74,6 +74,13 @@
    * @package HTTP protocol handling
    */
   
  +/**
  + * This hook allows modules to insert filters for the current error response
  + * @param r the current request
  + * @ingroup hooks
  + */
  +AP_DECLARE_HOOK(void,insert_error_filter,(request_rec *r))
  +
   /* This is an optimization.  We keep a record of the filter_rec that
    * stores the old_write filter, so that we can avoid strcmp's later.
    */
  
  
  
  1.474     +7 -0      httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.473
  retrieving revision 1.474
  diff -u -r1.473 -r1.474
  --- http_protocol.c	16 Nov 2003 02:09:13 -0000	1.473
  +++ http_protocol.c	12 Dec 2003 17:03:58 -0000	1.474
  @@ -182,6 +182,11 @@
       "510 Not Extended"
   };
   
  +APR_HOOK_STRUCT(
  +    APR_HOOK_LINK(insert_error_filter)
  +)
  +
  +AP_IMPLEMENT_HOOK_VOID(insert_error_filter, (request_rec *r), (r))
   
   /* The index of the first bit field that is used to index into a limit
    * bitmask. M_INVALID + 1 to METHOD_NUMBER_LAST.
  @@ -2341,6 +2346,8 @@
        */
   
       r->output_filters = r->proto_output_filters;
  +
  +    ap_run_insert_error_filter(r);
   
       /*
        * It's possible that the Location field might be in r->err_headers_out
  
  
  
  1.49      +2 -0      httpd-2.0/modules/metadata/mod_expires.c
  
  Index: mod_expires.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_expires.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- mod_expires.c	22 Nov 2003 02:11:00 -0000	1.48
  +++ mod_expires.c	12 Dec 2003 17:03:59 -0000	1.49
  @@ -205,6 +205,7 @@
   #include "http_config.h"
   #include "http_log.h"
   #include "http_request.h"
  +#include "http_protocol.h"
   
   typedef struct {
       int active;
  @@ -585,6 +586,7 @@
   {
       ap_register_output_filter("MOD_EXPIRES", expires_filter, NULL,
                                 AP_FTYPE_CONTENT_SET);
  +    ap_hook_insert_error_filter(expires_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
       ap_hook_insert_filter(expires_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
   }