You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Cliff Woolley <cl...@yahoo.com> on 2001/07/26 00:58:08 UTC
Re: cvs commit: httpd-2.0/include httpd.h
On 25 Jul 2001 wrowe@apache.org wrote:
> +#if APR_HAS_LARGE_FILES
> + if (r->finfo.size > AP_MAX_SENDFILE) {
> /* APR_HAS_LARGE_FILES issue; must split into mutiple buckets,
> * no greater than MAX(apr_size_t), and more granular than that
> * in case the brigade code/filters attempt to read it directly.
> */
> + apr_off_t fsize = r->finfo.size;
> + e = apr_bucket_file_create(fd, 0, AP_MAX_SENDFILE, r->pool);
> + while (fsize > AP_MAX_SENDFILE) {
> + APR_BRIGADE_INSERT_TAIL(bb, e);
> + apr_bucket_copy(e, &e);
> + e->start += AP_MAX_SENDFILE;
> + fsize -= AP_MAX_SENDFILE;
> + }
> + e->length = (apr_size_t)fsize; /* Resize just the last bucket */
> }
> + else
> #endif
> + e = apr_bucket_file_create(fd, 0, (apr_size_t)r->finfo.size, r->pool);
> +
> APR_BRIGADE_INSERT_TAIL(bb, e);
Cool, that works. Thanks.
> Index: mod_asis.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/modules/generators/mod_asis.c,v
> retrieving revision 1.37
> retrieving revision 1.38
> diff -u -r1.37 -r1.38
> --- mod_asis.c 2001/07/25 21:55:27 1.37
> +++ mod_asis.c 2001/07/25 22:38:21 1.38
> @@ -120,7 +120,7 @@
> if (!r->header_only) {
> apr_off_t start = 0;
> apr_off_t fsize = r->finfo.size;
> -#ifdef APR_HAS_LARGE_FILES
> +#if APR_HAS_LARGE_FILES
> /* must split into mutiple send_fd chunks */
> while (fsize > AP_MAX_SENDFILE) {
> ap_send_fd(f, r, start, AP_MAX_SENDFILE, &nbytes);
We might want to eliminate the use of ap_send_fd() here... it's creating
files buckets each time under the covers. I'll look into patching that.
--Cliff
--------------------------------------------------------------
Cliff Woolley
cliffwoolley@yahoo.com
Charlottesville, VA