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 Tue, 07 Aug 2001 17:57:45 GMT
rbb         01/08/07 10:57:45

  Modified:    modules/http http_protocol.c
  Log:
  Greatly simplify the ap_http_filter logic, by using the
  apr_brigade_partition function.  This should also remove a warning from
  the Windows build, because apr_off_t and apr_size_t aren't the same
  size.
  
  Revision  Changes    Path
  1.344     +2 -31     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.343
  retrieving revision 1.344
  diff -u -r1.343 -r1.344
  --- http_protocol.c	2001/08/07 16:40:29	1.343
  +++ http_protocol.c	2001/08/07 17:57:44	1.344
  @@ -656,37 +656,8 @@
              ### we could probably just use brigade_partition() in here.
           */
   
  -        while (!APR_BRIGADE_EMPTY(ctx->b)) {
  -            const char *ignore;
  -
  -            e = APR_BRIGADE_FIRST(ctx->b);
  -            if ((rv = apr_bucket_read(e, &ignore, &len, mode)) != APR_SUCCESS)
{
  -                /* probably APR_IS_EAGAIN(rv); socket state isn't correct;
  -                 * remove log once we get this squared away */
  -                ap_log_error(APLOG_MARK, APLOG_ERR, rv, f->c->base_server, 
  -                             "apr_bucket_read");
  -                return rv;
  -            }
  -
  -            if (len) {
  -                /* note: this can sometimes insert empty buckets into the
  -                 * brigade, or the data might come in a few characters at
  -                 * a time - don't assume that one call to apr_bucket_read()
  -                 * will return the full string.
  -                 */
  -                if (*readbytes < len) {
  -                    apr_bucket_split(e, *readbytes);
  -                    *readbytes = 0;
  -                }
  -                else {
  -                    *readbytes -= len;
  -                }
  -                APR_BUCKET_REMOVE(e);
  -                APR_BRIGADE_INSERT_TAIL(b, e);
  -                break; /* once we've gotten some data, deliver it to caller */
  -            }
  -            apr_bucket_delete(e);
  -        }
  +        apr_brigade_partition(ctx->b, *readbytes, &e);
  +        b = apr_brigade_split(ctx->b, e);
   
           /* ### this is a hack. it is saying, "if we have read everything
              ### that was requested, then we are at the end of the request."
  
  
  

Mime
View raw message