httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: cvs commit: httpd-2.0/server core.c
Date Tue, 01 May 2001 18:18:56 GMT
On Tue, 1 May 2001, Bill Stoddard wrote:

> This patch is seriously broken.  Request a very large file (100MB or
> greater) and watch what happens to memory usage.
>
> The problem is this loop. We basically read the entire content of the
> file into memory before sending it out on the network. Haven't given
> much though on the best way to fix this.
>
> >   +                APR_BRIGADE_FOREACH(bucket, b) {
> >   +                    const char *str;
> >   +                    apr_size_t n;
> >   +
> >   +                    rv = apr_bucket_read(bucket, &str, &n, APR_BLOCK_READ);
> >   +                    apr_brigade_write(ctx->b, NULL, NULL, str, n);
> >   +                }

Hmmm... that's not what the patch was supposed to do at all.  It was
supposed to read the file into memory, yes, but ONLY the "leftover" part
of the file, which is essentially (filesize % AP_MIN_BYTES_TO_SEND) bytes.

If it really is reading in the whole file, then you're right, it's broken.
I'll try to look into this later today, but no guarantees.

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message