You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2022/02/09 12:29:14 UTC

svn commit: r1897901 - in /httpd/httpd/branches/2.4.x: ./ STATUS changes-entries/mod_dav_memory_regresssion.txt modules/dav/main/props.c

Author: rpluem
Date: Wed Feb  9 12:29:13 2022
New Revision: 1897901

URL: http://svn.apache.org/viewvc?rev=1897901&view=rev
Log:
Merge r1897182, r1897614, r1897615, r1897619 from trunk:

* Allocate the dav_liveprop_elem structure only once in the lifetime of the
  resource->pool and reuse it to avoid unnecessary huge memory allocations
  during collection walks.


* CHANGES entry for r1897182

* Fix typo

* Stupid mine. Evgeny is a committer here

Reviewed by: rpluem, jorton, ylavic

Added:
    httpd/httpd/branches/2.4.x/changes-entries/mod_dav_memory_regresssion.txt
      - copied, changed from r1897614, httpd/httpd/trunk/changes-entries/mod_dav_memory_regresssion.txt
Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/dav/main/props.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1897182,1897614-1897615,1897619

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1897901&r1=1897900&r2=1897901&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Wed Feb  9 12:29:13 2022
@@ -179,18 +179,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
              Proposed for backport below, in place of or after this one.
      rpluem: +1 on PR 289 as well.
 
-  *) mod_dav: Fix regression when gathering properties which could lead to huge
-     memory consumption proportional to the number of resources.
-     Trunk version of patch:
-        https://svn.apache.org/r1897182
-        https://svn.apache.org/r1897614
-        https://svn.apache.org/r1897615
-        https://svn.apache.org/r1897619
-     Backport version for 2.4.x of patch:
-      Trunk version of patch works
-      svn merge -c 1897182,1897614,1897615,1897619 ^/httpd/httpd/trunk .
-     +1: rpluem, jorton, ylavic
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]

Copied: httpd/httpd/branches/2.4.x/changes-entries/mod_dav_memory_regresssion.txt (from r1897614, httpd/httpd/trunk/changes-entries/mod_dav_memory_regresssion.txt)
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/changes-entries/mod_dav_memory_regresssion.txt?p2=httpd/httpd/branches/2.4.x/changes-entries/mod_dav_memory_regresssion.txt&p1=httpd/httpd/trunk/changes-entries/mod_dav_memory_regresssion.txt&r1=1897614&r2=1897901&rev=1897901&view=diff
==============================================================================
--- httpd/httpd/trunk/changes-entries/mod_dav_memory_regresssion.txt (original)
+++ httpd/httpd/branches/2.4.x/changes-entries/mod_dav_memory_regresssion.txt Wed Feb  9 12:29:13 2022
@@ -1,3 +1,3 @@
-  *) mod_dav: Fix regression when gathering properties which could lead to hugei
+  *) mod_dav: Fix regression when gathering properties which could lead to huge
      memory consumption proportional to the number of resources.
-     [Evgeny Kotkov <ev...@visualsvn.com>, Ruediger Pluem]
+     [Evgeny Kotkov, Ruediger Pluem]

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=1897901&r1=1897900&r2=1897901&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 Wed Feb  9 12:29:13 2022
@@ -728,9 +728,15 @@ DAV_DECLARE(dav_get_props_result) dav_ge
     /* we lose both the document and the element when calling (insert_prop),
      * make these available in the pool.
      */
-    element = apr_pcalloc(propdb->resource->pool, sizeof(dav_liveprop_elem));
+    element = dav_get_liveprop_element(propdb->resource);
+    if (!element) {
+        element = apr_pcalloc(propdb->resource->pool, sizeof(dav_liveprop_elem));
+        apr_pool_userdata_setn(element, DAV_PROP_ELEMENT, NULL, propdb->resource->pool);
+    }
+    else {
+        memset(element, 0, sizeof(dav_liveprop_elem));
+    }
     element->doc = doc;
-    apr_pool_userdata_setn(element, DAV_PROP_ELEMENT, NULL, propdb->resource->pool);
 
     /* ### NOTE: we should pass in TWO buffers -- one for keys, one for
        the marks */