[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: testing DAV PROPFIND capabilities efficiently in r18513

From: Kazutoshi Satoda <k_satoda_at_f2.dion.ne.jp>
Date: 2006-03-07 01:44:05 CET

> When you "the last 'if(props)' part", do you mean the ones at the ends
> of svn_ra_dav__get_file() and svn_ra_dav__get_dir()?

I meant svn_ra_dav__get_dir().
Here is a quick patch. It is just compiled, not tested.

Index: subversion/libsvn_ra_dav/fetch.c
===================================================================
--- subversion/libsvn_ra_dav/fetch.c (revision 18747)
+++ subversion/libsvn_ra_dav/fetch.c (working copy)
@@ -922,14 +922,6 @@
    return SVN_NO_ERROR;
  }

-/* The property we need to fetch to see whether the server we are
- connected to supports the deadprop-count property. */
-static const ne_propname deadprop_count_support_props[] =
-{
- { SVN_DAV_PROP_NS_DAV, "deadprop-count" },
- { NULL }
-};
-
  svn_error_t *svn_ra_dav__get_dir(svn_ra_session_t *session,
                                   const char *path,
                                   svn_revnum_t revision,
@@ -939,7 +931,6 @@
                                   apr_hash_t **props,
                                   apr_pool_t *pool)
  {
- svn_ra_dav_resource_t *rsrc;
    apr_hash_index_t *hi;
    apr_hash_t *resources;
    const char *final_url;
@@ -972,25 +963,33 @@
          *fetched_rev = got_rev;
      }

- /* For issue 2151: See if we are dealing with a server that
- understands the deadprop-count property. If it doesn't, we'll
- need to do an allprop PROPFIND. If it does, we'll execute a more
- targeted PROPFIND. */
    {
- const svn_string_t *deadprop_count;
-
+ svn_ra_dav_resource_t *rsrc;
+ static const ne_propname deadprop_count_support_props[] =
+ {
+ { SVN_DAV_PROP_NS_DAV, "deadprop-count" },
+ { NULL }
+ };
+ const ne_propname *const props_we_want
+ = props ? NULL /* all props */ : deadprop_count_support_props;
      SVN_ERR(svn_ra_dav__get_props_resource(&rsrc, ras->sess,
                                             final_url, NULL,
- deadprop_count_support_props,
+ props_we_want,
                                             pool));
-
- deadprop_count = apr_hash_get(rsrc->propset,
+ if(props)
+ {
+ *props = apr_hash_make(pool);
+ SVN_ERR(filter_props(*props, rsrc, TRUE, pool));
+ }
+ /* For issue 2151: See if we are dealing with a server that
+ understands the deadprop-count property. If it doesn't, we'll
+ need to do an allprop PROPFIND. If it does, we'll execute a more
+ targeted PROPFIND. */
+ supports_deadprop_count = (apr_hash_get(rsrc->propset,
                                    SVN_RA_DAV__PROP_DEADPROP_COUNT,
- APR_HASH_KEY_STRING);
-
- supports_deadprop_count = (deadprop_count != NULL);
+ APR_HASH_KEY_STRING) != NULL);
    }
-
+
    if (dirents)
      {
        ne_propname *which_props;
@@ -1214,16 +1213,6 @@
          }
      }

- if (props)
- {
- SVN_ERR(svn_ra_dav__get_props_resource(&rsrc, ras->sess, final_url,
- NULL, NULL /* all props */,
- pool));
-
- *props = apr_hash_make(pool);
- SVN_ERR(filter_props(*props, rsrc, TRUE, pool));
- }
-
    return SVN_NO_ERROR;
  }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Mar 7 01:44:30 2006

This is an archived mail posted to the Subversion Dev mailing list.