Re: [PATCH] Handle conditional requests in mod_dav

2005-02-11 Thread Justin Erenkrantz
On Fri, Feb 11, 2005 at 03:05:01PM +0100, Sander Striker wrote:
> The point of this small patch is to allow mod_dav to take an easy
> out instead of actually going through the (expensive) delivery
> step, in case of a conditional request.  Think of cache
> validating requests for instance.

Makes sense.  +1.  -- justin


[PATCH] Handle conditional requests in mod_dav

2005-02-11 Thread Sander Striker
Hi,

The point of this small patch is to allow mod_dav to take an easy
out instead of actually going through the (expensive) delivery
step, in case of a conditional request.  Think of cache
validating requests for instance.

I found this interesting because of the potential of serving
content straight from a SVN repository, while retaining
near static content performance*.  That is, with mod_cache
enabled.

*) Ofcourse opening the repository on each connection is a
   penalty, but hey, that needs addressing elsewhere.

Makes sense?

Sander

---
Log:
* modules/dav/main/mod_dav.c

  (dav_method_get): Handle conditional requests.


Index: modules/dav/main/mod_dav.c
===
--- modules/dav/main/mod_dav.c  (revision 153370)
+++ modules/dav/main/mod_dav.c  (working copy)
@@ -813,6 +813,7 @@
 {
 dav_resource *resource;
 dav_error *err;
+int status;
 
 /* This method should only be called when the resource is not
  * visible to Apache. We will fetch the resource from the repository,
@@ -836,6 +837,12 @@
 return dav_handle_err(r, err, NULL);
 }
 
+/* Handle conditional requests */
+status = ap_meets_conditions(r);
+if (status) {
+  return status;
+}
+
 if (r->header_only) {
 return DONE;
 }