From: Ben Reser Date: Sun, 3 May 2015 18:02:33 +0000 (+0000) Subject: mod_dav: Avoid doing the walk on a COPY source for handling preconditions if X-Git-Tag: 2.5.0-alpha~3177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40670acf6b06b35b46fb69e3b38950f14b43a2c2;p=thirdparty%2Fapache%2Fhttpd.git mod_dav: Avoid doing the walk on a COPY source for handling preconditions if 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 --- diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c index e6207fde8c3..3d4b1ec3d85 100644 --- a/modules/dav/main/util.c +++ b/modules/dav/main/util.c @@ -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;