You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ma...@apache.org on 2023/01/09 14:52:27 UTC

svn commit: r1906506 - in /httpd/httpd/branches/2.4.x: ./ docs/manual/mod/ modules/dav/main/

Author: manu
Date: Mon Jan  9 14:52:27 2023
New Revision: 1906506

URL: http://svn.apache.org/viewvc?rev=1906506&view=rev
Log:
  *) mod_dav: DAVlockDiscovery option to disable WebDAV lock discovery
     This is a game changer for performances if client use PROPFIND a lot,

PR: 66313
Submited by: manu
Reviewed by: manu, covener, gbechis


Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.en
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.fr.utf8
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ja.utf8
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ko.euc-kr
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml.fr
    httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c
    httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.h
    httpd/httpd/branches/2.4.x/modules/dav/main/props.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1904638,1904662,1905170,1905206,1905230

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Mon Jan  9 14:52:27 2023
@@ -43,6 +43,10 @@ Changes with Apache 2.4.55
      HeartbeatMaxServers default to the documented value 10 in 2.4.54.
      PR 66131.  [Jérôme Billiras]
 
+  *) mod_dav: DAVlockDiscovery option to disable WebDAV lock discovery
+     This is a game changer for performances if client use PROPFIND a lot,
+     PR 66313. [Emmanuel Dreyfus]
+
 Changes with Apache 2.4.54
 
   *) SECURITY: CVE-2022-31813: mod_proxy X-Forwarded-For dropped by

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Mon Jan  9 14:52:27 2023
@@ -149,17 +149,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_dav: DAVlockDiscovery option to disable WebDAV lock discovery
-     This is a game changer for performances if client use PROPFIND a lot,
-     trunk patch: http://svn.apache.org/r1904638
-                  http://svn.apache.org/r1904662
-                  http://svn.apache.org/r1905170
-                  http://svn.apache.org/r1905206
-                  http://svn.apache.org/r1905230
-     2.4.x patch: svn merge -c 1904638,1904662,1905170,1905206,1905230 ^/httpd/httpd/trunk .
-     +1: manu, covener, gbechis
-     covener: xml needs doc tweak after backport
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.en?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.en (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.en Mon Jan  9 14:52:27 2023
@@ -53,6 +53,7 @@
 <div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3 class="directives">Directives</h3>
 <ul id="toc">
 <li><img alt="" src="../images/down.gif" /> <a href="#davlockdb">DavLockDB</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#davlockdiscovery">DavLockDiscovery</a></li>
 </ul>
 <h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_dav_fs">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_dav_fs">Report a bug</a></li></ul><h3>See also</h3>
 <ul class="seealso">
@@ -90,6 +91,26 @@
 
 
 </div>
+<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="directive-section"><h2><a name="DavLockDiscovery" id="DavLockDiscovery">DavLockDiscovery</a> <a name="davlockdiscovery" id="davlockdiscovery">Directive</a> <a title="Permanent link" href="#davlockdiscovery" class="permalink">&para;</a></h2>
+<table class="directive">
+<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enable lock discovery</td></tr>
+<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DavLockDiscovery on|off</code></td></tr>
+<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DavLockDiscovery on</code></td></tr>
+<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
+<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
+<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dav_fs</td></tr>
+<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available from Apache 2.5.0 and later.</td></tr>
+</table>
+    <p><code class="directive">DavLockDiscovery</code> controls if the lock
+    discovery feature is enabled for <code>PROPFIND</code> method.
+    When disabled, <code>PROPFIND</code> always returns an empty
+    <code>lockdiscovery</code> section. This improves performance
+    if clients use <code>PROPFIND</code> a lot.</p>
+    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">DavLockDiscovery off</pre>
+</div>
+
+</div>
 </div>
 <div class="bottomlang">
 <p><span>Available Languages: </span><a href="../en/mod/mod_dav_fs.html" title="English">&nbsp;en&nbsp;</a> |

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.fr.utf8
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.fr.utf8?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.fr.utf8 [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.fr.utf8 [utf-8] Mon Jan  9 14:52:27 2023
@@ -55,6 +55,7 @@
 <div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3 class="directives">Directives</h3>
 <ul id="toc">
 <li><img alt="" src="../images/down.gif" /> <a href="#davlockdb">DavLockDB</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#davlockdiscovery">DavLockDiscovery</a></li>
 </ul>
 <h3>Traitement des bugs</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">Journal des modifications de httpd</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_dav_fs">Problèmes connus</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_dav_fs">Signaler un bug</a></li></ul><h3>Voir aussi</h3>
 <ul class="seealso">
@@ -96,6 +97,27 @@
 
 
 </div>
+<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="directive-section"><h2><a name="davlockdiscovery" id="davlockdiscovery">Directive</a> <a name="DavLockDiscovery" id="DavLockDiscovery">DavLockDiscovery</a> <a title="Lien permanent" href="#davlockdiscovery" class="permalink">&para;</a></h2>
+<table class="directive">
+<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Active la découverte des verrous</td></tr>
+<tr><th><a href="directive-dict.html#Syntax">Syntaxe:</a></th><td><code>DavLockDiscovery on|off</code></td></tr>
+<tr><th><a href="directive-dict.html#Default">Défaut:</a></th><td><code>DavLockDiscovery on</code></td></tr>
+<tr><th><a href="directive-dict.html#Context">Contexte:</a></th><td>configuration globale, serveur virtuel, répertoire, .htaccess</td></tr>
+<tr><th><a href="directive-dict.html#Status">Statut:</a></th><td>Extension</td></tr>
+<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_dav_fs</td></tr>
+<tr><th><a href="directive-dict.html#Compatibility">Compatibilité:</a></th><td>Disponible à partir de Apache 2.5.0.</td></tr>
+</table>
+    <p><code class="directive">DavLockDiscovery</code> contrôle la 
+    découverte des verrous par la méthode <code>PROPFIND</code>.
+    Lorsqu'elle est désactivée, <code>PROPFIND</code> renvoie
+    toujours une section <code>lockdiscovery</code> vide. Ce
+    réglage améliore les performances dans le cas où des
+    clients utilisent beaucoup <code>PROPFIND</code>.</p>
+    <div class="example"><h3>Example</h3><pre class="prettyprint lang-config">DavLockDiscovery off</pre>
+</div>
+
+</div>
 </div>
 <div class="bottomlang">
 <p><span>Langues Disponibles: </span><a href="../en/mod/mod_dav_fs.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ja.utf8
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ja.utf8?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ja.utf8 [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ja.utf8 [utf-8] Mon Jan  9 14:52:27 2023
@@ -60,6 +60,7 @@
 <div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3 class="directives">ディレクティブ</h3>
 <ul id="toc">
 <li><img alt="" src="../images/down.gif" /> <a href="#davlockdb">DavLockDB</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#davlockdiscovery">DavLockDiscovery</a></li>
 </ul>
 <h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_dav_fs">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_dav_fs">Report a bug</a></li></ul><h3>参照</h3>
 <ul class="seealso">
@@ -88,6 +89,19 @@
     </code></p></div>
 
 </div>
+<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="directive-section"><h2><a name="DavLockDiscovery" id="DavLockDiscovery">DavLockDiscovery</a> <a name="davlockdiscovery" id="davlockdiscovery">ディレクティブ</a> <a title="Permanent link" href="#davlockdiscovery" class="permalink">&para;</a></h2>
+<table class="directive">
+<tr><th><a href="directive-dict.html#Description">説明:</a></th><td>Enable lock discovery</td></tr>
+<tr><th><a href="directive-dict.html#Syntax">構文:</a></th><td><code>DavLockDiscovery on|off</code></td></tr>
+<tr><th><a href="directive-dict.html#Default">デフォルト:</a></th><td><code>DavLockDiscovery on</code></td></tr>
+<tr><th><a href="directive-dict.html#Context">コンテキスト:</a></th><td>サーバ設定ファイル, バーチャルホスト, ディレクトリ, .htaccess</td></tr>
+<tr><th><a href="directive-dict.html#Status">ステータス:</a></th><td>Extension</td></tr>
+<tr><th><a href="directive-dict.html#Module">モジュール:</a></th><td>mod_dav_fs</td></tr>
+<tr><th><a href="directive-dict.html#Compatibility">互換性:</a></th><td>Available from Apache 2.5.0 and later.</td></tr>
+</table><p>このディレクティブの解説文書は
+            まだ翻訳されていません。英語版をご覧ください。
+            </p></div>
 </div>
 <div class="bottomlang">
 <p><span>翻訳済み言語: </span><a href="../en/mod/mod_dav_fs.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ko.euc-kr
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ko.euc-kr?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ko.euc-kr [euc-kr] (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.html.ko.euc-kr [euc-kr] Mon Jan  9 14:52:27 2023
@@ -55,6 +55,7 @@
 <div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><h3 class="directives">지시어들</h3>
 <ul id="toc">
 <li><img alt="" src="../images/down.gif" /> <a href="#davlockdb">DavLockDB</a></li>
+<li><img alt="" src="../images/down.gif" /> <a href="#davlockdiscovery">DavLockDiscovery</a></li>
 </ul>
 <h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_dav_fs">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_dav_fs">Report a bug</a></li></ul><h3>참고</h3>
 <ul class="seealso">
@@ -93,6 +94,19 @@
 
 
 </div>
+<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
+<div class="directive-section"><h2><a name="DavLockDiscovery" id="DavLockDiscovery">DavLockDiscovery</a> <a name="davlockdiscovery" id="davlockdiscovery">지시어</a> <a title="Permanent link" href="#davlockdiscovery" class="permalink">&para;</a></h2>
+<table class="directive">
+<tr><th><a href="directive-dict.html#Description">설명:</a></th><td>Enable lock discovery</td></tr>
+<tr><th><a href="directive-dict.html#Syntax">문법:</a></th><td><code>DavLockDiscovery on|off</code></td></tr>
+<tr><th><a href="directive-dict.html#Default">기본값:</a></th><td><code>DavLockDiscovery on</code></td></tr>
+<tr><th><a href="directive-dict.html#Context">사용장소:</a></th><td>주서버설정, 가상호스트, directory, .htaccess</td></tr>
+<tr><th><a href="directive-dict.html#Status">상태:</a></th><td>Extension</td></tr>
+<tr><th><a href="directive-dict.html#Module">모듈:</a></th><td>mod_dav_fs</td></tr>
+<tr><th><a href="directive-dict.html#Compatibility">지원:</a></th><td>Available from Apache 2.5.0 and later.</td></tr>
+</table><p>The documentation for this directive has
+            not been translated yet. Please have a look at the English
+            version.</p></div>
 </div>
 <div class="bottomlang">
 <p><span>가능한 언어: </span><a href="../en/mod/mod_dav_fs.html" hreflang="en" rel="alternate" title="English">&nbsp;en&nbsp;</a> |

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml Mon Jan  9 14:52:27 2023
@@ -87,5 +87,31 @@
 </usage>
 </directivesynopsis>
 
+<directivesynopsis>
+<name>DavLockDiscovery</name>
+<description>Enable lock discovery</description>
+<syntax>DavLockDiscovery on|off</syntax>
+<default>DavLockDiscovery on</default>
+<contextlist><context>server config</context>
+<context>virtual host</context>
+<context>directory</context>
+<context>.htaccess</context>
+</contextlist>
+<compatibility>Available from Apache 2.5.0 and later.</compatibility>
+
+<usage>
+    <p><directive>DavLockDiscovery</directive> controls if the lock
+    discovery feature is enabled for <code>PROPFIND</code> method.
+    When disabled, <code>PROPFIND</code> always returns an empty
+    <code>lockdiscovery</code> section. This improves performance
+    if clients use <code>PROPFIND</code> a lot.</p>
+    <example><title>Example</title>
+     <highlight language="config">
+      DavLockDiscovery off
+     </highlight>
+    </example>
+</usage>
+</directivesynopsis>
+
 </modulesynopsis>
 

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml.fr
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml.fr?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml.fr [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_dav_fs.xml.fr [utf-8] Mon Jan  9 14:52:27 2023
@@ -97,5 +97,32 @@ host</context>
 </usage>
 </directivesynopsis>
 
+<directivesynopsis>
+<name>DavLockDiscovery</name>
+<description>Active la découverte des verrous</description>
+<syntax>DavLockDiscovery on|off</syntax>
+<default>DavLockDiscovery on</default>
+<contextlist><context>server config</context>
+<context>virtual host</context>
+<context>directory</context>
+<context>.htaccess</context>
+</contextlist>
+<compatibility>Disponible à partir de Apache 2.5.0.</compatibility>
+
+<usage>
+    <p><directive>DavLockDiscovery</directive> contrôle la 
+    découverte des verrous par la méthode <code>PROPFIND</code>.
+    Lorsqu'elle est désactivée, <code>PROPFIND</code> renvoie
+    toujours une section <code>lockdiscovery</code> vide. Ce
+    réglage améliore les performances dans le cas où des
+    clients utilisent beaucoup <code>PROPFIND</code>.</p>
+    <example><title>Example</title>
+     <highlight language="config">
+      DavLockDiscovery off
+     </highlight>
+    </example>
+</usage>
+</directivesynopsis>
+
 </modulesynopsis>
 

Modified: httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c (original)
+++ httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c Mon Jan  9 14:52:27 2023
@@ -83,6 +83,7 @@ typedef struct {
     const char *dir;
     int locktimeout;
     int allow_depthinfinity;
+    int allow_lockdiscovery;
 
 } dav_dir_conf;
 
@@ -197,6 +198,8 @@ static void *dav_merge_dir_config(apr_po
     newconf->dir = DAV_INHERIT_VALUE(parent, child, dir);
     newconf->allow_depthinfinity = DAV_INHERIT_VALUE(parent, child,
                                                      allow_depthinfinity);
+    newconf->allow_lockdiscovery = DAV_INHERIT_VALUE(parent, child,
+                                                     allow_lockdiscovery);
 
     return newconf;
 }
@@ -295,6 +298,21 @@ static const char *dav_cmd_davdepthinfin
 }
 
 /*
+ * Command handler for the DAVLockDiscovery directive, which is FLAG.
+ */
+static const char *dav_cmd_davlockdiscovery(cmd_parms *cmd, void *config,
+                                            int arg)
+{
+    dav_dir_conf *conf = (dav_dir_conf *)config;
+
+    if (arg)
+        conf->allow_lockdiscovery = DAV_ENABLED_ON;
+    else
+        conf->allow_lockdiscovery = DAV_ENABLED_OFF;
+    return NULL;
+}
+
+/*
  * Command handler for DAVMinTimeout directive, which is TAKE1
  */
 static const char *dav_cmd_davmintimeout(cmd_parms *cmd, void *config,
@@ -1419,7 +1437,7 @@ static dav_error *dav_gen_supported_live
     }
 
     /* open the property database (readonly) for the resource */
-    if ((err = dav_open_propdb(r, lockdb, resource, 1, NULL,
+    if ((err = dav_open_propdb(r, lockdb, resource, DAV_PROPDB_RO, NULL,
                                &propdb)) != NULL) {
         if (lockdb != NULL)
             (*lockdb->hooks->close_lockdb)(lockdb);
@@ -2014,6 +2032,8 @@ static void dav_cache_badprops(dav_walke
 static dav_error * dav_propfind_walker(dav_walk_resource *wres, int calltype)
 {
     dav_walker_ctx *ctx = wres->walk_ctx;
+    dav_dir_conf *conf;
+    int flags = DAV_PROPDB_RO;
     dav_error *err;
     dav_propdb *propdb;
     dav_get_props_result propstats = { 0 };
@@ -2025,6 +2045,10 @@ static dav_error * dav_propfind_walker(d
         return NULL;
     }
 
+    conf = ap_get_module_config(ctx->r->per_dir_config, &dav_module);
+    if (conf && conf->allow_lockdiscovery == DAV_ENABLED_OFF)
+        flags |= DAV_PROPDB_DISABLE_LOCKDISCOVERY;
+
     /*
     ** Note: ctx->doc can only be NULL for DAV_PROPFIND_IS_ALLPROP. Since
     ** dav_get_allprops() does not need to do namespace translation,
@@ -2034,7 +2058,7 @@ static dav_error * dav_propfind_walker(d
     ** the resource, however, since we are opening readonly.
     */
     err = dav_popen_propdb(ctx->scratchpool,
-                           ctx->r, ctx->w.lockdb, wres->resource, 1,
+                           ctx->r, ctx->w.lockdb, wres->resource, flags,
                            ctx->doc ? ctx->doc->namespaces : NULL, &propdb);
     if (err != NULL) {
         /* ### do something with err! */
@@ -2419,7 +2443,8 @@ static int dav_method_proppatch(request_
         return dav_handle_err(r, err, NULL);
     }
 
-    if ((err = dav_open_propdb(r, NULL, resource, 0, doc->namespaces,
+    if ((err = dav_open_propdb(r, NULL, resource,
+                               DAV_PROPDB_NONE, doc->namespaces,
                                &propdb)) != NULL) {
         /* undo any auto-checkout */
         dav_auto_checkin(r, resource, 1 /*undo*/, 0 /*unlock*/, &av_info);
@@ -5149,6 +5174,11 @@ static const command_rec dav_cmds[] =
                  ACCESS_CONF|RSRC_CONF,
                  "allow Depth infinity PROPFIND requests"),
 
+    /* per directory/location, or per server */
+    AP_INIT_FLAG("DAVLockDiscovery", dav_cmd_davlockdiscovery, NULL,
+                 ACCESS_CONF|RSRC_CONF,
+                 "allow lock discovery by PROPFIND requests"),
+
     { NULL }
 };
 

Modified: httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.h?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.h (original)
+++ httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.h Mon Jan  9 14:52:27 2023
@@ -1685,12 +1685,15 @@ struct dav_hooks_locks
 
 typedef struct dav_propdb dav_propdb;
 
+#define DAV_PROPDB_NONE                  0 
+#define DAV_PROPDB_RO                    1
+#define DAV_PROPDB_DISABLE_LOCKDISCOVERY 2 
 
 DAV_DECLARE(dav_error *) dav_open_propdb(
     request_rec *r,
     dav_lockdb *lockdb,
     const dav_resource *resource,
-    int ro,
+    int flags,
     apr_array_header_t *ns_xlate,
     dav_propdb **propdb);
 
@@ -1699,7 +1702,7 @@ DAV_DECLARE(dav_error *) dav_popen_propd
     request_rec *r,
     dav_lockdb *lockdb,
     const dav_resource *resource,
-    int ro,
+    int flags,
     apr_array_header_t *ns_xlate,
     dav_propdb **propdb);
 

Modified: httpd/httpd/branches/2.4.x/modules/dav/main/props.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/dav/main/props.c?rev=1906506&r1=1906505&r2=1906506&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/dav/main/props.c (original)
+++ httpd/httpd/branches/2.4.x/modules/dav/main/props.c Mon Jan  9 14:52:27 2023
@@ -185,6 +185,8 @@ struct dav_propdb {
 
     dav_buffer wb_lock;           /* work buffer for lockdiscovery property */
 
+    int flags;                    /* ro, disable lock discovery */
+
     /* if we ever run a GET subreq, it will be stored here */
     request_rec *subreq;
 
@@ -351,6 +353,11 @@ static dav_error * dav_insert_coreprop(d
     switch (propid) {
 
     case DAV_PROPID_CORE_lockdiscovery:
+        if (propdb->flags & DAV_PROPDB_DISABLE_LOCKDISCOVERY) {
+            value = "";
+            break;
+        }
+
         if (propdb->lockdb != NULL) {
             dav_lock *locks;
 
@@ -522,17 +529,18 @@ static dav_error *dav_really_open_db(dav
 
 DAV_DECLARE(dav_error *)dav_open_propdb(request_rec *r, dav_lockdb *lockdb,
                                         const dav_resource *resource,
-                                        int ro,
+                                        int flags,
                                         apr_array_header_t * ns_xlate,
                                         dav_propdb **p_propdb)
 {
-    return dav_popen_propdb(r->pool, r, lockdb, resource, ro, ns_xlate, p_propdb);
+    return dav_popen_propdb(r->pool, r, lockdb, resource,
+                            flags, ns_xlate, p_propdb);
 }
 
 DAV_DECLARE(dav_error *)dav_popen_propdb(apr_pool_t *p,
                                          request_rec *r, dav_lockdb *lockdb,
                                          const dav_resource *resource,
-                                         int ro,
+                                         int flags,
                                          apr_array_header_t * ns_xlate,
                                          dav_propdb **p_propdb)
 {
@@ -559,6 +567,8 @@ DAV_DECLARE(dav_error *)dav_popen_propdb
 
     propdb->lockdb = lockdb;
 
+    propdb->flags = flags;
+
     /* always defer actual open, to avoid expense of accessing db
      * when only live properties are involved
      */