rbb 00/12/31 16:29:56
Modified: src/buckets ap_buckets.c ap_buckets_file.c
Log:
APR-util can not rely on a flag from Apache to determine if we should be
using MMAP files. We should always use MMAP files if APR supports them.
Revision Changes Path
1.40 +1 -1 apr-util/src/buckets/ap_buckets.c
Index: ap_buckets.c
===================================================================
RCS file: /home/cvs/apr-util/src/buckets/ap_buckets.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- ap_buckets.c 2000/12/22 16:54:58 1.39
+++ ap_buckets.c 2001/01/01 00:29:56 1.40
@@ -260,7 +260,7 @@
ap_insert_bucket_type(&ap_eos_type);
ap_insert_bucket_type(&ap_file_type);
ap_insert_bucket_type(&ap_heap_type);
-#ifdef AP_USE_MMAP_FILES
+#ifdef APR_HAS_MMAP
ap_insert_bucket_type(&ap_mmap_type);
#endif
ap_insert_bucket_type(&ap_pipe_type);
1.16 +6 -5 apr-util/src/buckets/ap_buckets_file.c
Index: ap_buckets_file.c
===================================================================
RCS file: /home/cvs/apr-util/src/buckets/ap_buckets_file.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ap_buckets_file.c 2000/12/21 18:06:15 1.15
+++ ap_buckets_file.c 2001/01/01 00:29:56 1.16
@@ -52,13 +52,14 @@
* <http://www.apache.org/>.
*/
+#include "apr.h"
#include "apr_lib.h"
#include "apr_file_io.h"
#include "ap_buckets.h"
#include <stdlib.h>
/* Allow Apache to use ap_mmap */
-#ifdef AP_USE_MMAP_FILES
+#ifdef APR_HAS_MMAP
#include "apr_mmap.h"
/* mmap support for static files based on ideas from John Heidemann's
@@ -80,7 +81,7 @@
#ifndef MMAP_LIMIT
#define MMAP_LIMIT (4*1024*1024)
#endif
-#endif /* AP_USE_MMAP_FILES */
+#endif /* APR_HAS_MMAP */
/* XXX: We should obey the block flag */
@@ -92,11 +93,11 @@
ap_bucket *b = NULL;
char *buf;
apr_status_t rv;
-#ifdef AP_USE_MMAP_FILES
+#ifdef APR_HAS_MMAP
apr_mmap_t *mm = NULL;
#endif
-#ifdef AP_USE_MMAP_FILES
+#ifdef APR_HAS_MMAP
if ((e->length >= MMAP_THRESHOLD)
&& (e->length < MMAP_LIMIT)) {
/* we need to protect ourselves in case we die while we've got the
@@ -154,7 +155,7 @@
b = ap_bucket_create_file(f, 0, e->length);
AP_BUCKET_INSERT_AFTER(e, b);
}
-#ifdef AP_USE_MMAP_FILES
+#ifdef APR_HAS_MMAP
}
#endif
return APR_SUCCESS;