diff options
author | jwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68> | 2002-05-15 23:10:52 +0000 |
---|---|---|
committer | jwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68> | 2002-05-15 23:10:52 +0000 |
commit | 116f03ec726893c013b48baf696bc1625d0eb621 (patch) | |
tree | 4c466f7c69398db714ff672369e6fc834a110da4 /buckets | |
parent | a5e6bed37d114480efbf9f16828b3fcfc96775aa (diff) | |
download | libapr-util-116f03ec726893c013b48baf696bc1625d0eb621.tar.gz |
file_bucket_read() is not the only caller of file_make_mmap().
file_bucket_setaside() does it as well, and that call was missed when
the can_mmap flag was added. This patch moves the can_mmap test to
a central location to avoid that problem.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@58643 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'buckets')
-rw-r--r-- | buckets/apr_buckets_file.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/buckets/apr_buckets_file.c b/buckets/apr_buckets_file.c index abc8edf7..d07b5073 100644 --- a/buckets/apr_buckets_file.c +++ b/buckets/apr_buckets_file.c @@ -85,6 +85,10 @@ static int file_make_mmap(apr_bucket *e, apr_size_t filelength, apr_bucket_file *a = e->data; apr_mmap_t *mm; + if (!a->can_mmap) { + return 0; + } + if (filelength > APR_MMAP_LIMIT) { if (apr_mmap_create(&mm, a->fd, fileoffset, APR_MMAP_LIMIT, APR_MMAP_READ, p) != APR_SUCCESS) { @@ -122,8 +126,7 @@ static apr_status_t file_bucket_read(apr_bucket *e, const char **str, #endif #if APR_HAS_MMAP - if (a->can_mmap && - file_make_mmap(e, filelength, fileoffset, a->readpool)) { + if (file_make_mmap(e, filelength, fileoffset, a->readpool)) { return apr_bucket_read(e, str, len, block); } #endif |