httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_protocol.c
Date Sat, 18 Nov 2000 04:53:23 GMT
rbb         00/11/17 20:53:23

  Modified:    src      CHANGES
               src/main http_protocol.c
  Log:
  Fix 204 handling.  This moves some logic that used to be in
  ap_send_error_response to the http_header filter.  The reason for the move,
  is that the header filter takes care of all header processing now.  Without
  this change, we were sending garbage data to the client whenever we sent
  304 responses.
  Submitted by:	Brian Havard and Ryan Bloom
  
  Revision  Changes    Path
  1.339     +6 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.338
  retrieving revision 1.339
  diff -u -r1.338 -r1.339
  --- CHANGES	2000/11/18 03:17:21	1.338
  +++ CHANGES	2000/11/18 04:53:22	1.339
  @@ -1,4 +1,10 @@
   Changes with Apache 2.0a8
  +  *) Fix 304 processing.  The core should never try to send the headers
  +     down the filter stack.  Always, just setup the table in the request
  +     record, and let the header filter convert it to data that is ready
  +     for the network.
  +     [Ryan Bloom]
  +
     *) More fixes for the proxy.  There are still bugs in the proxy code,
        but this has now proxied www.yahoo.com and www.ntrnet.net (my ISP)
        successfully.
  
  
  
  1.249     +36 -47    apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.248
  retrieving revision 1.249
  diff -u -r1.248 -r1.249
  --- http_protocol.c	2000/11/17 13:57:32	1.248
  +++ http_protocol.c	2000/11/18 04:53:23	1.249
  @@ -2519,8 +2519,25 @@
           apr_table_unset(r->headers_out, "Content-Length");
       }
   
  -    apr_table_do((int (*) (void *, const char *, const char *)) compute_header_len,
  +    if (r->status == HTTP_NOT_MODIFIED) {
  +        apr_table_do((int (*)(void *, const char *, const char *)) compute_header_len,
  +                    (void *) &len, r->headers_out,
  +                    "Connection",
  +                    "Keep-Alive",
  +                    "ETag",
  +                    "Content-Location",
  +                    "Expires",
  +                    "Cache-Control",
  +                    "Vary",
  +                    "Warning",
  +                    "WWW-Authenticate",
  +                    "Proxy-Authenticate",
  +                    NULL);
  +    }
  +    else {
  +        apr_table_do((int (*) (void *, const char *, const char *)) compute_header_len,
                    (void *) &len, r->headers_out, NULL);
  +    }
       
       /* Need to add a fudge factor so that the CRLF at the end of the headers
        * and the basic http headers don't overflow this buffer.
  @@ -2533,8 +2550,25 @@
       h.r = r;
       h.buf = buff;
   
  -    apr_table_do((int (*) (void *, const char *, const char *)) form_header_field,
  +    if (r->status == HTTP_NOT_MODIFIED) {
  +        apr_table_do((int (*)(void *, const char *, const char *)) form_header_field,
  +                    (void *) &h, r->headers_out,
  +                    "Connection",
  +                    "Keep-Alive",
  +                    "ETag",
  +                    "Content-Location",
  +                    "Expires",
  +                    "Cache-Control",
  +                    "Vary",
  +                    "Warning",
  +                    "WWW-Authenticate",
  +                    "Proxy-Authenticate",
  +                    NULL);
  +    }
  +    else {
  +        apr_table_do((int (*) (void *, const char *, const char *)) form_header_field,
   		 (void *) &h, r->headers_out, NULL);
  +    }
   
       terminate_header(buff);
   
  @@ -3294,51 +3328,6 @@
        * message body.  Note that being assbackwards here is not an option.
        */
       if (status == HTTP_NOT_MODIFIED) {
  -        char *buff;
  -        header_struct h;
  -        ap_bucket *e;
  -        ap_bucket_brigade *bb;
  -        apr_size_t len = 0;
  -
  -        if (!apr_is_empty_table(r->err_headers_out))
  -            r->headers_out = apr_overlay_tables(r->pool, r->err_headers_out,
  -						r->headers_out);
  -
  -        apr_table_do((int (*) (void *, const char *, const char *)) compute_header_len,
  -                     (void *) &len, r->headers_out, NULL);
  -     
  -        /* Need to add a fudge factor so that the CRLF at the end of the headers
  -         * and the basic http headers don't overflow this buffer.
  -         */
  -        len += strlen(ap_get_server_version()) + 100;
  -        buff = apr_pcalloc(r->pool, len);
  -        e = ap_bucket_create_pool(buff, len, r->pool);
  -        ap_basic_http_header(r, buff);
  -        ap_set_keepalive(r);
  -
  -        h.r = r;
  -        h.buf = buff;
  -
  -        apr_table_do((int (*)(void *, const char *, const char *)) form_header_field,
  -                    (void *) &h, r->headers_out,
  -                    "Connection",
  -                    "Keep-Alive",
  -                    "ETag",
  -                    "Content-Location",
  -                    "Expires",
  -                    "Cache-Control",
  -                    "Vary",
  -                    "Warning",
  -                    "WWW-Authenticate",
  -                    "Proxy-Authenticate",
  -                    NULL);
  -
  -        terminate_header(buff);
  -       
  -        bb = ap_brigade_create(r->pool);
  -        AP_BRIGADE_INSERT_HEAD(bb, e);
  -        ap_pass_brigade(r->connection->output_filters, bb);
  -
           ap_finalize_request_protocol(r);
           return;
       }
  
  
  

Mime
View raw message