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 2004/01/07 03:49:47 UTC

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

rederpj     2004/01/06 18:49:46

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               include  Tag: APACHE_2_0_BRANCH ap_mmn.h http_protocol.h
               modules/http Tag: APACHE_2_0_BRANCH http_protocol.c
               modules/metadata Tag: APACHE_2_0_BRANCH mod_expires.c
  Log:
  Backporting the following from Apache 2.1-dev to 2.0.49-dev:
  
    *) 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.
  
  Reviewed by: trawick, stoddard
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.210 +6 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.209
  retrieving revision 1.988.2.210
  diff -u -r1.988.2.209 -r1.988.2.210
  --- CHANGES	6 Jan 2004 04:36:54 -0000	1.988.2.209
  +++ CHANGES	7 Jan 2004 02:49:45 -0000	1.988.2.210
  @@ -1,5 +1,11 @@
   Changes with Apache 2.0.49
   
  +  *) 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]
  +
     *) Add Polish translation of error messages.  PR 25101.
        [Tomasz Kepczynski <tomek jot23.org>]
   
  
  
  
  1.751.2.615 +2 -13     httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.614
  retrieving revision 1.751.2.615
  diff -u -r1.751.2.614 -r1.751.2.615
  --- STATUS	4 Jan 2004 15:07:04 -0000	1.751.2.614
  +++ STATUS	7 Jan 2004 02:49:45 -0000	1.751.2.615
  @@ -87,18 +87,7 @@
       * Fix segfault in mod_mem_cache cache_insert() due to cache size
         becoming negative.  PR: 21285, 21287
         http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/experimental/mod_mem_cache.c?r1=1.99&r2=1.100
  -      +1: stoddard
  -
  -    * 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.
  -      PR: 19794, 24884, and 25123.
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/include/http_protocol.h?r1=1.84&r2=1.85
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/http/http_protocol.c?r1=1.473&r2=1.474
  -      http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/metadata/mod_expires.c?r1=1.48&r2=1.49
  -        nd: yes, it's a minor bump
  -      +1: rederpj, trawick (requires minor MMN bump I believe), stoddard
  +      +1: stoddard, rederpj
   
       * Replace some of the mutex locking in the worker MPM with
         atomic operations for higher concurrency.
  
  
  
  No                   revision
  No                   revision
  1.52.2.7  +2 -1      httpd-2.0/include/ap_mmn.h
  
  Index: ap_mmn.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/ap_mmn.h,v
  retrieving revision 1.52.2.6
  retrieving revision 1.52.2.7
  diff -u -r1.52.2.6 -r1.52.2.7
  --- ap_mmn.h	1 Jan 2004 13:30:37 -0000	1.52.2.6
  +++ ap_mmn.h	7 Jan 2004 02:49:46 -0000	1.52.2.7
  @@ -115,6 +115,7 @@
    * 20020903.3 (2.0.46-dev) allow_encoded_slashes added to core_dir_config
    * 20020903.4 (2.0.47-dev) add ap_is_recursion_limit_exceeded()
    * 20020903.5 (2.0.49-dev) add ap_escape_errorlog_item()
  + * 20020903.6 (2.0.49-dev) add insert_error_filter hook
    */
   
   #define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */
  @@ -122,7 +123,7 @@
   #ifndef MODULE_MAGIC_NUMBER_MAJOR
   #define MODULE_MAGIC_NUMBER_MAJOR 20020903
   #endif
  -#define MODULE_MAGIC_NUMBER_MINOR 5                     /* 0...n */
  +#define MODULE_MAGIC_NUMBER_MINOR 6                     /* 0...n */
   
   /**
    * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
  
  
  
  1.83.2.3  +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.83.2.2
  retrieving revision 1.83.2.3
  diff -u -r1.83.2.2 -r1.83.2.3
  --- http_protocol.h	1 Jan 2004 13:30:37 -0000	1.83.2.2
  +++ http_protocol.h	7 Jan 2004 02:49:46 -0000	1.83.2.3
  @@ -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.
    */
  
  
  
  No                   revision
  No                   revision
  1.463.2.8 +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.463.2.7
  retrieving revision 1.463.2.8
  diff -u -r1.463.2.7 -r1.463.2.8
  --- http_protocol.c	1 Jan 2004 13:30:40 -0000	1.463.2.7
  +++ http_protocol.c	7 Jan 2004 02:49:46 -0000	1.463.2.8
  @@ -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.
  @@ -2324,6 +2329,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
  
  
  
  No                   revision
  No                   revision
  1.39.2.7  +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.39.2.6
  retrieving revision 1.39.2.7
  diff -u -r1.39.2.6 -r1.39.2.7
  --- mod_expires.c	1 Jan 2004 13:30:41 -0000	1.39.2.6
  +++ mod_expires.c	7 Jan 2004 02:49:46 -0000	1.39.2.7
  @@ -205,6 +205,7 @@
   #include "http_config.h"
   #include "http_log.h"
   #include "http_request.h"
  +#include "http_protocol.h"
   
   typedef struct {
       int active;
  @@ -548,6 +549,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);
   }