]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_dav: Avoid doing the walk on a COPY source for handling preconditions if
authorBen Reser <breser@apache.org>
Sun, 3 May 2015 18:02:33 +0000 (18:02 +0000)
committerBen Reser <breser@apache.org>
Sun, 3 May 2015 18:02:33 +0000 (18:02 +0000)
there are no preconditions provided.

* modules/dav/main/util.c:
  (dav_validate_request): avoid validating locks and ETags when there are
    no If headers providing them on a resource we aren't modifying.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1677462 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/main/util.c

index e6207fde8c30313f4bf0ea55f0bf9e127fddcf9d..3d4b1ec3d85b7c0b1fb684c5085b313d8ff0bd50 100644 (file)
@@ -1595,8 +1595,10 @@ DAV_DECLARE(dav_error *) dav_validate_request(request_rec *r,
         }
     }
 
-    /* (1) Validate the specified resource, at the specified depth */
-    if (resource->exists && depth > 0) {
+    /* (1) Validate the specified resource, at the specified depth.
+     * Avoid the walk there is no if_header and we aren't planning
+     * to modify this resource. */
+    if (resource->exists && depth > 0 && !(!if_header && flags & DAV_VALIDATE_NO_MODIFY)) {
         dav_walker_ctx ctx = { { 0 } };
         dav_response *multi_status;