Author: pburba
Date: Thu Apr 12 21:40:24 2012
New Revision: 1325534

URL: http://svn.apache.org/viewvc?rev=1325534&view=rev
Log:
On the inheritable-props branch: Use iterpools in some recent changes, no
functional change.

* subversion/mod_dav_svn/reports/inherited-props.c
  (dav_svn__get_inherited_props_report): Use iterpools.

* subversion/svnserve/serve.c
  (get_file,
   get_dir):  Use iterpools.

Modified:
    
subversion/branches/inheritable-props/subversion/mod_dav_svn/reports/inherited-props.c
    subversion/branches/inheritable-props/subversion/svnserve/serve.c

Modified: 
subversion/branches/inheritable-props/subversion/mod_dav_svn/reports/inherited-props.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/mod_dav_svn/reports/inherited-props.c?rev=1325534&r1=1325533&r2=1325534&view=diff
==============================================================================
--- 
subversion/branches/inheritable-props/subversion/mod_dav_svn/reports/inherited-props.c
 (original)
+++ 
subversion/branches/inheritable-props/subversion/mod_dav_svn/reports/inherited-props.c
 Thu Apr 12 21:40:24 2012
@@ -49,8 +49,7 @@ dav_svn__get_inherited_props_report(cons
                                     const apr_xml_doc *doc,
                                     ap_filter_t *output)
 {
-  /* ### IPROS TODO: Subpool */
-  /* ### IPROS TODO: Authz   */
+  /* ### IPROPS TODO: Authz   */
   svn_error_t *serr;
   dav_error *derr = NULL;
   apr_xml_elem *child;
@@ -62,6 +61,7 @@ dav_svn__get_inherited_props_report(cons
   svn_fs_root_t *root;
   int i;
   svn_revnum_t rev = SVN_INVALID_REVNUM;
+  apr_pool_t *iterpool;
 
   /* Sanity check. */
   ns = dav_svn__find_ns(doc->namespaces, SVN_XML_NAMESPACE);
@@ -75,6 +75,8 @@ dav_svn__get_inherited_props_report(cons
                                     SVN_DAV_ERROR_TAG);
     }
 
+  iterpool = svn_pool_create(resource->pool);
+
   for (child = doc->root->first_child;
        child != NULL;
        child = child->next)
@@ -85,12 +87,12 @@ dav_svn__get_inherited_props_report(cons
 
       if (strcmp(child->name, SVN_DAV__REVISION) == 0)
         {
-          rev = SVN_STR_TO_REV(dav_xml_get_cdata(child, resource->pool, 1));
+          rev = SVN_STR_TO_REV(dav_xml_get_cdata(child, iterpool, 1));
         }
       else if (strcmp(child->name, SVN_DAV__PATH) == 0)
         {
           path = dav_xml_get_cdata(child, resource->pool, 0);
-          if ((derr = dav_svn__test_canonical(path, resource->pool)))
+          if ((derr = dav_svn__test_canonical(path, iterpool)))
             return derr;
           path = svn_fspath__join(resource->info->repos_path, path,
                                   resource->pool);
@@ -113,7 +115,7 @@ dav_svn__get_inherited_props_report(cons
                                 resource->pool);
 
   serr = svn_fs_node_proplist2(NULL, &inherited_props, root, path,
-                               resource->pool, resource->pool);
+                               resource->pool, iterpool);
 
   if (serr)
     {
@@ -139,6 +141,8 @@ dav_svn__get_inherited_props_report(cons
       svn_prop_inherited_item_t *elt =
         APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
 
+      svn_pool_clear(iterpool);
+
       serr = dav_svn__brigade_printf(
         bb, output,
         "<S:" SVN_DAV__IPROP_ITEM ">"
@@ -163,7 +167,7 @@ dav_svn__get_inherited_props_report(cons
                 bb, output,
                 "<S:" SVN_DAV__IPROP_PROPNAME ">%s</S:"
                 SVN_DAV__IPROP_PROPNAME ">" DEBUG_CR,
-                apr_xml_quote_string(resource->pool, propname, 0));
+                apr_xml_quote_string(iterpool, propname, 0));
 
               if (!serr)
                 {
@@ -171,7 +175,7 @@ dav_svn__get_inherited_props_report(cons
                     {
                       svn_stringbuf_t *tmp = NULL;
                       svn_xml_escape_cdata_string(&tmp, propval,
-                                                  resource->pool);
+                                                  iterpool);
                       xml_safe = tmp->data;
                       serr = dav_svn__brigade_printf(
                         bb, output,
@@ -181,7 +185,7 @@ dav_svn__get_inherited_props_report(cons
                   else
                     {
                       xml_safe = svn_base64_encode_string2(
-                        propval, TRUE, resource->pool)->data;
+                        propval, TRUE, iterpool)->data;
                       serr = dav_svn__brigade_printf(
                         bb, output,
                         "<S:" SVN_DAV__IPROP_PROPVAL
@@ -224,7 +228,7 @@ dav_svn__get_inherited_props_report(cons
   dav_svn__operational_log(resource->info,
                            svn_log__get_inherited_props(path, rev,
                                                         resource->pool));
-
+  svn_pool_destroy(iterpool);
   return dav_svn__final_flush_or_error(resource->info->r, bb, output,
                                        derr, resource->pool);
 }

Modified: subversion/branches/inheritable-props/subversion/svnserve/serve.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/inheritable-props/subversion/svnserve/serve.c?rev=1325534&r1=1325533&r2=1325534&view=diff
==============================================================================
--- subversion/branches/inheritable-props/subversion/svnserve/serve.c (original)
+++ subversion/branches/inheritable-props/subversion/svnserve/serve.c Thu Apr 
12 21:40:24 2012
@@ -1446,18 +1446,22 @@ static svn_error_t *get_file(svn_ra_svn_
 
   if (wants_inherited_props)
     {
+      apr_pool_t *iterpool = svn_pool_create(pool);
+
       SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(?!"));
       for (i = 0; i < inherited_props->nelts; i++)
         {
           svn_prop_inherited_item_t *iprop =
             APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
 
-          SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!(c(!",
+          svn_pool_clear(iterpool);
+          SVN_ERR(svn_ra_svn_write_tuple(conn, iterpool, "!(c(!",
                                          iprop->path_or_url));
-          SVN_ERR(svn_ra_svn_write_proplist(conn, pool, iprop->prop_hash));
-          SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!))!",
+          SVN_ERR(svn_ra_svn_write_proplist(conn, iterpool, iprop->prop_hash));
+          SVN_ERR(svn_ra_svn_write_tuple(conn, iterpool, "!))!",
                                          iprop->path_or_url));
-        }  
+        }
+      svn_pool_destroy(iterpool);
     }
 
   SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!))"));
@@ -1661,18 +1665,22 @@ static svn_error_t *get_dir(svn_ra_svn_c
 
   if (wants_inherited_props)
     {
+      apr_pool_t *iterpool = svn_pool_create(pool);
+
       SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(?!"));
       for (i = 0; i < inherited_props->nelts; i++)
         {
           svn_prop_inherited_item_t *iprop =
             APR_ARRAY_IDX(inherited_props, i, svn_prop_inherited_item_t *);
 
+          svn_pool_clear(iterpool);
           SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!(c(!",
                                          iprop->path_or_url));
           SVN_ERR(svn_ra_svn_write_proplist(conn, pool, iprop->prop_hash));
           SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!))!",
                                          iprop->path_or_url));
-        }  
+        }
+      svn_pool_destroy(iterpool);
     }
 
   /* Finish response. */


Reply via email to