httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/modules/generators mod_asis.c
Date Wed, 10 Oct 2001 20:02:40 GMT
wrowe       01/10/10 13:02:40

  Modified:    modules/generators mod_asis.c
  Log:
    Support huge files from mod_asis
  
  Revision  Changes    Path
  1.42      +18 -0     httpd-2.0/modules/generators/mod_asis.c
  
  Index: mod_asis.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_asis.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- mod_asis.c	2001/10/10 18:37:35	1.41
  +++ mod_asis.c	2001/10/10 20:02:40	1.42
  @@ -131,6 +131,24 @@
           }
   
           bb = apr_brigade_create(r->pool);
  +#if APR_HAS_LARGE_FILES
  +        if (r->finfo.size - pos > 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 - pos;
  +            e = apr_bucket_file_create(fd, pos, 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
           b = apr_bucket_file_create(f, pos, (apr_size_t) (r->finfo.size - pos), r->pool);
           APR_BRIGADE_INSERT_TAIL(bb, b);
           b = apr_bucket_eos_create();
  
  
  

Mime
View raw message