httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Clark <mich...@metaparadigm.com>
Subject VFS Proof of concept
Date Sun, 23 Dec 2007 03:50:59 GMT
Attached is a proof of concept for an Apache VFS layer.

There is a consumer API which just mimics the APR file IO API with
the addition of a request_rec *r argument (see example patch to
consumer code).

There is a provider interface using an ap_vfs_mount structure that
can be filled out and there is a default implementation that directly
delegates to the APR file IO routines.

It could probably be cleaned up a little with some helper macros
to reduce the duplication in the interface definitions.

I have not yet considered a mounting/stacking API - there is a very
simple get_mount implementation that allows me to test this for stacking
by exporting a list head (I have my mod_privsep working against this).

Index: server/core.c
===================================================================
--- server/core.c       (revision 604779)
+++ server/core.c       (working copy)
@@ -49,6 +49,7 @@
 #include "mod_core.h"
 #include "mod_proxy.h"
 #include "ap_listen.h"
+#include "ap_vfs.h"
 
 #include "mod_so.h" /* for ap_find_loaded_module_symbol */
 
@@ -3600,7 +3601,7 @@
         }
 
 
-        if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY
+        if ((status = ap_vfs_file_open(r, &fd, r->filename, APR_READ | APR_BINARY
 #if APR_HAS_SENDFILE
                             | ((d->enable_sendfile == ENABLE_SENDFILE_OFF)
                                                 ? 0 : APR_SENDFILE_ENABLED)



Mime
View raw message