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_protocol.c
Date Wed, 24 Jan 2001 23:47:44 GMT
rbb         01/01/24 15:47:43

  Modified:    modules/http http_protocol.c
  Log:
  As Greg noted, set_keepalive has to happen before we check r->chunked, but
  it also has to happen after ap_basic_http_header.  Otherwise, we don't
  set r->connection->keepalive correctly, and it can be -1 for requests that
  don't support keepalive.  This moves ap_basic_http_header to above the
  call to set_keepalive (after reversing the previous patch), which should
  be perfectly safe, while still fixing the original bug.
  Submitted by:	Greg Stein
  
  Revision  Changes    Path
  1.277     +14 -13    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.276
  retrieving revision 1.277
  diff -u -d -b -w -u -r1.276 -r1.277
  --- http_protocol.c	2001/01/24 23:07:23	1.276
  +++ http_protocol.c	2001/01/24 23:47:42	1.277
  @@ -2479,6 +2479,20 @@
   	fixup_vary(r);
       }
   
  +    /* 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_start = buff = apr_pcalloc(r->pool, len);
  +    ap_basic_http_header(r, buff);
  +    buff += strlen(buff);
  +
  +    h.r = r;
  +    h.buf = buff;
  +
  +
  +    ap_set_keepalive(r);
  +
       if (r->chunked) {
           apr_table_mergen(r->headers_out, "Transfer-Encoding", "chunked");
           apr_table_unset(r->headers_out, "Content-Length");
  @@ -2551,17 +2565,6 @@
                    (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_start = buff = apr_pcalloc(r->pool, len);
  -    ap_basic_http_header(r, buff);
  -    buff += strlen(buff);
  -
  -    h.r = r;
  -    h.buf = buff;
  -
       if (r->status == HTTP_NOT_MODIFIED) {
           apr_table_do((int (*)(void *, const char *, const char *)) form_header_field,
                       (void *) &h, r->headers_out,
  @@ -2583,8 +2586,6 @@
       }
   
       terminate_header(buff);
  -
  -    ap_set_keepalive(r);
   
       r->sent_bodyct = 1;         /* Whatever follows is real body stuff... */
   
  
  
  

Mime
View raw message