httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/modules/http http_core.c http_protocol.c
Date Mon, 04 Mar 2002 05:54:45 GMT
rbb         02/03/03 21:54:45

  Modified:    modules/http http_core.c http_protocol.c
  Log:
  Adding the same filters over and over again used to be okay, because
  we would lose the extra filters.  Now, if a filter is added, it is run.
  Unfortunately, this can cause an infinite loop, or it can cause request
  headers to appear twice.  This commit removes two instances in the core
  where we were inserting filters for a second and third time.  The bug
  was that error responses were causing infinite loops.
  
  This also removes the reset_filters function, which did the exact
  same thing as add_required_filters.  The two functions were both called
  in error conditions, which was part of what caused this bug.
  
  Revision  Changes    Path
  1.295     +1 -1      httpd-2.0/modules/http/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_core.c,v
  retrieving revision 1.294
  retrieving revision 1.295
  diff -u -r1.294 -r1.295
  --- http_core.c	3 Mar 2002 22:34:55 -0000	1.294
  +++ http_core.c	4 Mar 2002 05:54:44 -0000	1.295
  @@ -304,7 +304,7 @@
   
   static void ap_http_insert_filter(request_rec *r)
   {
  -    if (!r->main) {
  +    if (!r->main && !r->prev) {
           ap_add_output_filter_handle(ap_byterange_filter_handle,
                                       NULL, r, r->connection);
           ap_add_output_filter_handle(ap_content_length_filter_handle,
  
  
  
  1.393     +0 -11     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.392
  retrieving revision 1.393
  diff -u -r1.392 -r1.393
  --- http_protocol.c	27 Feb 2002 03:55:31 -0000	1.392
  +++ http_protocol.c	4 Mar 2002 05:54:44 -0000	1.393
  @@ -1843,16 +1843,6 @@
       }
   }
   
  -static void reset_filters(request_rec *r)
  -{
  -    /* only reset request level filters,
  -     * connection level filters need to remain in tact
  -     */
  -    r->output_filters = r->connection->output_filters;
  -    ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection);
  -    ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection);
  -}
  -
   /* We should have named this send_canned_response, since it is used for any
    * response that can be generated by the server from the request record.
    * This includes all 204 (no content), 3xx (redirect), 4xx (client error),
  @@ -1870,7 +1860,6 @@
        * this value.
        */
       r->eos_sent = 0;
  -    reset_filters(r);
   
       /*
        * It's possible that the Location field might be in r->err_headers_out
  
  
  

Mime
View raw message