httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_core.c
Date Thu, 14 Sep 2000 02:16:09 GMT
fanf        00/09/13 19:16:09

  Modified:    src/main http_core.c
  Log:
  Improve the way the chunking filter handles zero-length buckets,
  and fix the comment explaining how to reduce the incidence of tiny chunks.
  Submitted by:	Jeff Trawick
  Reviewed by:	Tony Finch
  
  Revision  Changes    Path
  1.120     +20 -13    apache-2.0/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_core.c,v
  retrieving revision 1.119
  retrieving revision 1.120
  diff -u -u -r1.119 -r1.120
  --- http_core.c	2000/09/13 23:13:17	1.119
  +++ http_core.c	2000/09/14 02:16:07	1.120
  @@ -2951,25 +2951,31 @@
   		break;
   	    }
   	    else if (e->length == -1) {
  -                /* Bucket Of Interdeterminate Length (BOIL). (e.g. a pipe) */
  -
  +                /* unknown amount of data (e.g. a pipe) */
   		const char *data;
   		apr_ssize_t len;
   
  -                /* this will construct a new bucket */
   		rv = e->read(e, &data, &len, 1);
   		if (rv != APR_SUCCESS) {
   		    return rv;
   		}
  -		bytes += len;
  -
  -                /*
  -                 * We split between the new bucket and the BOIL. We'll come
  -                 * back for the rest of the brigade later (reading more out
  -                 * of the BOIL, possibly splitting again
  -                 */
  -		more = ap_brigade_split(b, AP_BUCKET_NEXT(e));
  -		break;
  +		if (len > 0) {
  +		    /*
  +		     * There may be a new next bucket representing the
  +		     * rest of the data stream on which a read() may
  +		     * block so we pass down what we have so far.
  +		     */
  +		    bytes += len;
  +		    more = ap_brigade_split(b, AP_BUCKET_NEXT(e));
  +		    break;
  +		}
  +		else {
  +		    /* If there was nothing in this bucket then we can
  +		     * safely move on to the next one without pausing
  +		     * to pass down what we have counted up so far.
  +		     */
  +		    continue;
  +		}
   	    }
   	    else {
   		bytes += e->length;
  @@ -2978,7 +2984,8 @@
   
   	/*
   	 * XXX: if there aren't very many bytes at this point it may
  -	 * be a good idea to set them aside and return for more.
  +	 * be a good idea to set them aside and return for more,
  +	 * unless we haven't finished counting this brigade yet.
   	 */
   
           /* if there are content bytes, then wrap them in a chunk */
  
  
  

Mime
View raw message