httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject cvs commit: httpd-2.0/modules/http http_request.c
Date Fri, 01 Jun 2001 17:35:08 GMT
minfrin     01/06/01 10:35:08

  Modified:    .        CHANGES
               modules/http http_request.c
  Log:
  Add a check to ap_die() to make sure the filter stack is sane and
  contains the correct basic filters when an error occurs. This fixes
  a problem where headers are not being sent on error.
  Submitted by:	John Sterling
  
  Revision  Changes    Path
  1.211     +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.210
  retrieving revision 1.211
  diff -u -r1.210 -r1.211
  --- CHANGES	2001/06/01 04:39:06	1.210
  +++ CHANGES	2001/06/01 17:35:04	1.211
  @@ -1,4 +1,9 @@
   Changes with Apache 2.0.19-dev
  +
  +  *) Add a check to ap_die() to make sure the filter stack is sane and
  +     contains the correct basic filters when an error occurs. This fixes
  +     a problem where headers are not being sent on error. [John Sterling]
  +
     *) New Header directive 'echo' option. "Header echo regex" will
        cause any headers received on the request that match regex to be
        echoed to (included in) the response headers.
  
  
  
  1.102     +23 -0     httpd-2.0/modules/http/http_request.c
  
  Index: http_request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- http_request.c	2001/06/01 17:26:15	1.101
  +++ http_request.c	2001/06/01 17:35:07	1.102
  @@ -91,6 +91,28 @@
   #include <stdarg.h>
   #endif
   
  +static void add_required_filters(request_rec *r)
  +{
  +    ap_filter_t *f = r->output_filters;
  +    int has_core = 0, has_content = 0, has_http_header = 0;
  +    while (f) {
  +        if(!strcasecmp(f->frec->name, "CORE"))
  +            has_core = 1; 
  +        else if(!strcasecmp(f->frec->name, "CONTENT_LENGTH"))
  +            has_content = 1; 
  +        else if(!strcasecmp(f->frec->name, "HTTP_HEADER")) 
  +            has_http_header = 1;
  +        f = f->next;
  +    }
  +    if(!has_core) 
  +        ap_add_output_filter("CORE", NULL, r, r->connection);
  +    if(!has_content)
  +        ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection);
  +    if(!has_http_header) 
  +        ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection);
  +
  +}
  +
   /*****************************************************************
    *
    * Mainline request processing...
  @@ -201,6 +223,7 @@
                           custom_response);
           }
       }
  +    add_required_filters(r);
       ap_send_error_response(r, recursive_error);
   }
   
  
  
  

Mime
View raw message