You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2003/08/31 18:14:39 UTC

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

jerenkrantz    2003/08/31 09:14:39

  Modified:    .        CHANGES STATUS
               modules/http http_protocol.c
  Log:
  Resolve the ap_get_client_block() showstopper by looking at APR_BRIGADE_LAST
  of what we get from ap_get_brigade and set a nugget for our next call to
  pick up on.
  
  Revision  Changes    Path
  1.1265    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1264
  retrieving revision 1.1265
  diff -u -u -r1.1264 -r1.1265
  --- CHANGES	28 Aug 2003 05:54:44 -0000	1.1264
  +++ CHANGES	31 Aug 2003 16:14:38 -0000	1.1265
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Modify ap_get_client_block() to note if it has seen EOS.
  +     [Justin Erenkrantz]
  +
     *) The bucket brigades subsystem now honors the MaxMemFree setting.
        [Cliff Woolley, Jean-Jacques Clar]
   
  
  
  
  1.771     +1 -4      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.770
  retrieving revision 1.771
  diff -u -u -r1.770 -r1.771
  --- STATUS	6 Aug 2003 04:02:34 -0000	1.770
  +++ STATUS	31 Aug 2003 16:14:38 -0000	1.771
  @@ -28,9 +28,6 @@
       * the edge connection filter cannot be removed 
         http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=105366252619530&w=2
   
  -    * bug in ap_get_client_block (wrong handling of EOS)
  -      http://marc.theaimsgroup.com/?l=apache-httpd-dev&m=105281649228629&w=2
  -
   CURRENT VOTES:
   
       * Promote mod_cache from experimental to non-experimental
  
  
  
  1.471     +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.470
  retrieving revision 1.471
  diff -u -u -r1.470 -r1.471
  --- http_protocol.c	6 Jun 2003 02:48:55 -0000	1.470
  +++ http_protocol.c	31 Aug 2003 16:14:39 -0000	1.471
  @@ -1910,6 +1910,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;
  @@ -1936,7 +1940,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);