You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2003/09/17 12:47:39 UTC

cvs commit: httpd-2.0/modules/http http_protocol.c

trawick     2003/09/17 03:47:39

  Modified:    .        Tag: APACHE_2_0_BRANCH STATUS CHANGES
               modules/http Tag: APACHE_2_0_BRANCH http_protocol.c
  Log:
  merge this fix from 2.1-dev:
  
      * Fix EOS handling in ap_get_client_block.
  
  Submitted by:	jerenkrantz
  Reviewed by:	trawick, fielding
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.751.2.475 +1 -6      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.474
  retrieving revision 1.751.2.475
  diff -u -r1.751.2.474 -r1.751.2.475
  --- STATUS	17 Sep 2003 10:39:43 -0000	1.751.2.474
  +++ STATUS	17 Sep 2003 10:47:38 -0000	1.751.2.475
  @@ -333,11 +333,6 @@
           modules/ssl/ssl_engine_io.c r1.111
         +1: jorton
   
  -    * Fix EOS handling in ap_get_client_block.
  -        modules/http/http_protocol.c: r1.471
  -      See Message-ID: <3E...@stason.org>
  -      +1: jerenkrantz, trawick, fielding
  -
   CURRENT RELEASE NOTES:
   
       * Backwards compatibility is expected of future Apache 2.0 releases,
  
  
  
  1.988.2.156 +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.155
  retrieving revision 1.988.2.156
  diff -u -r1.988.2.155 -r1.988.2.156
  --- CHANGES	17 Sep 2003 10:39:43 -0000	1.988.2.155
  +++ CHANGES	17 Sep 2003 10:47:38 -0000	1.988.2.156
  @@ -1,5 +1,8 @@
   Changes with Apache 2.0.48
   
  +  *) Modify ap_get_client_block() to note if it has seen EOS.
  +     [Justin Erenkrantz]
  +
     *) Fix a bug, where mod_deflate sometimes unconditionally compressed the
        content if the Accept-Encoding header contained only other tokens than
        "gzip" (such as "deflate"). PR 21523.  [Joe Orton, Andr� Malo]
  
  
  
  No                   revision
  No                   revision
  1.463.2.5 +19 -1     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.4
  retrieving revision 1.463.2.5
  diff -u -r1.463.2.4 -r1.463.2.5
  --- http_protocol.c	7 Jul 2003 19:11:36 -0000	1.463.2.4
  +++ http_protocol.c	17 Sep 2003 10:47:39 -0000	1.463.2.5
  @@ -1890,6 +1890,10 @@
       apr_status_t rv;
       apr_bucket_brigade *bb;
   
  +    if (r->remaining < 0 || (!r->read_chunked && r->remaining == 0)) {
  +        return 0;
  +    }
  +
       bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
       if (bb == NULL) {
           r->connection->keepalive = AP_CONN_CLOSE;
  @@ -1916,7 +1920,21 @@
        * returning data when requested.
        */
       AP_DEBUG_ASSERT(!APR_BRIGADE_EMPTY(bb));
  - 
  +
  +    /* Check to see if EOS in the brigade.
  +     *
  +     * If so, we have to leave a nugget for the *next* ap_get_client_block
  +     * call to return 0.
  +     */
  +    if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
  +        if (r->read_chunked) {
  +            r->remaining = -1;
  +        }
  +        else {
  +            r->remaining = 0;
  +        }
  +    }
  +
       rv = apr_brigade_flatten(bb, buffer, &bufsiz);
       if (rv != APR_SUCCESS) {
           apr_brigade_destroy(bb);