From: William A. Rowe Jr Date: Wed, 25 Jul 2001 21:55:27 +0000 (+0000) Subject: Same fix for largefile support as core.c X-Git-Tag: 2.0.22~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61815da03c3e8c9126f55485909740f743bc57ea;p=thirdparty%2Fapache%2Fhttpd.git Same fix for largefile support as core.c git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89716 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/generators/mod_asis.c b/modules/generators/mod_asis.c index a7520495b4d..36fd0a4d1e1 100644 --- a/modules/generators/mod_asis.c +++ b/modules/generators/mod_asis.c @@ -118,10 +118,17 @@ static int asis_handler(request_rec *r) } if (!r->header_only) { - /* XXX: APR_HAS_LARGE_FILES issue; need to split into mutiple send_fd - * chunks, no greater than MAX(apr_size_t). - */ - ap_send_fd(f, r, 0, r->finfo.size, &nbytes); + apr_off_t start = 0; + apr_off_t fsize = r->finfo.size; +#ifdef 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); + start += AP_MAX_SENDFILE; + fsize -= AP_MAX_SENDFILE; + } +#endif + ap_send_fd(f, r, start, (apr_size_t)fsize, &nbytes); } apr_file_close(f);