Got tired of having to set core_private for one bit of info. How does this
look?
Index: server/request.c
===================================================================
--- server/request.c (revision 699033)
+++ server/request.c (working copy)
@@ -1907,3 +1907,14 @@
return (r->main == NULL) /* otherwise, this is a sub-request */
&& (r->prev == NULL); /* otherwise, this is an internal
redirect */
}
+
+AP_DECLARE(int) ap_sendfile_enabled(request_rec *r)
+{
+ int rc = 0;
+#if APR_HAS_SENDFILE
+ core_dir_config *conf = ap_get_module_config(r->per_dir_config,
+ &core_module);
+ rc = conf->enable_sendfile == ENABLE_SENDFILE_OFF;
+#endif
+ return rc;
+}
Index: include/httpd.h
===================================================================
--- include/httpd.h (revision 699033)
+++ include/httpd.h (working copy)
@@ -1541,6 +1541,13 @@
AP_DECLARE(int) ap_count_dirs(const char *path);
/**
+ * Is sendfile enabled for this request
+ * @param r the current request
+ * @return 1 if enabled, 0 is not
+ */
+AP_DECLARE(int) ap_sendfile_enabled(request_rec *r);
+
+/**
* Copy at most @a n leading directories of @a s into @a d. @a d
* should be at least as large as @a s plus 1 extra byte
*
--
Brian Akins
Chief Operations Engineer
Turner Digital Media Technologies