httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aa...@apache.org
Subject cvs commit: httpd-2.0/modules/http http_protocol.c
Date Tue, 16 Oct 2001 01:04:09 GMT
aaron       01/10/15 18:04:09

  Modified:    modules/http http_protocol.c
  Log:
  Cautiously avoiding the scoping issue that was discussed on the list,
  I thought these other changes needed to go in; Namely that we don't
  need to check if the brigade is empty twice in the loop, just once.
  Added a comment for good measure.
  
  Revision  Changes    Path
  1.374     +13 -14    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.373
  retrieving revision 1.374
  diff -u -r1.373 -r1.374
  --- http_protocol.c	2001/10/14 20:38:04	1.373
  +++ http_protocol.c	2001/10/16 01:04:08	1.374
  @@ -1370,22 +1370,21 @@
                                                       &core_module);
       apr_bucket_brigade *bb = req_cfg->bb;
   
  -    do {
  +    /* read until we get a non-empty brigade */
  +    while (APR_BRIGADE_EMPTY(bb)) {
           apr_off_t len_read;
  -        if (APR_BRIGADE_EMPTY(bb)) {
  -            len_read = r->remaining;
  -            if (ap_get_brigade(r->input_filters, bb, AP_MODE_BLOCKING,
  -                               &len_read) != APR_SUCCESS) {
  -                /* if we actually fail here, we want to just return and
  -                 * stop trying to read data from the client.
  -                 */
  -                r->connection->keepalive = -1;
  -                apr_brigade_destroy(bb);
  -                return -1;
  -            }
  -            r->remaining -= len_read;
  +        len_read = r->remaining;
  +        if (ap_get_brigade(r->input_filters, bb, AP_MODE_BLOCKING,
  +                           &len_read) != APR_SUCCESS) {
  +            /* if we actually fail here, we want to just return and
  +             * stop trying to read data from the client.
  +             */
  +            r->connection->keepalive = -1;
  +            apr_brigade_destroy(bb);
  +            return -1;
           }
  -    } while (APR_BRIGADE_EMPTY(bb));
  +        r->remaining -= len_read;
  +    } 
   
       b = APR_BRIGADE_FIRST(bb);
       if (APR_BUCKET_IS_EOS(b)) { /* reached eos on previous invocation */
  
  
  

Mime
View raw message