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 ]
--- /dev/null
+ *) mod_dav: Fix regression when gathering properties which could lead to huge
+ memory consumption proportional to the number of resources.
+ [Evgeny Kotkov, Ruediger Pluem]
/* 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 */