Author: stsp
Date: Sun Apr 19 14:58:57 2015
New Revision: 1674627
URL: http://svn.apache.org/r1674627
Log:
Put jcorvel's workaround for issue #4351 into mod_dav_svn's implementation.
* subversion/mod_dav_svn/repos.c
(get_resource): Set a Depth header with value "0" on copy requests.
This prevents mod_dav's precondition check from recursing over the copy
source tree and thus restores O(1) behaviour for 'svn copy' with current
httpd releases.
The alternative of patching mod_dav was also considered but has been
dismissed. Ideally, there would be an API between mod_dav and its
providers to enable/disable the precondition tree walk.
Patch by: me
gstein
Modified:
subversion/trunk/subversion/mod_dav_svn/repos.c
Modified: subversion/trunk/subversion/mod_dav_svn/repos.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/repos.c?rev=1674627&r1=1674626&r2=1674627&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/repos.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/repos.c Sun Apr 19 14:58:57 2015
@@ -2126,6 +2126,16 @@ get_resource(request_rec *r,
xslt_uri = dav_svn__get_xslt_uri(r);
fs_parent_path = dav_svn__get_fs_parent_path(r);
+ if (r->method_number == M_COPY)
+ {
+ /* Workaround for issue #4531: Avoid a depth-infinity walk on
+ the copy source by overriding the Depth header here.
+ mod_dav defaults to infinite depth if this header is not set
+ which makes copies O(size of source) rather than the desired O(1).
+ ### Should be fixed by an explicit provider API feature in mod_dav. */
+ apr_table_setn(r->headers_in, "Depth", "0");
+ }
+
/* Special case: detect and build the SVNParentPath as a unique type
of private resource, iff the SVNListParentPath directive is 'on'. */
if (dav_svn__is_parentpath_list(r))