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

Reporting an error when failing to compute a liveprop

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Tue, 21 Feb 2012 13:01:01 +0200

When failing to compute a liveprop, currently we just claim that its
value is "###error###". (We used to claim "0" for filesize.)

The following patch makes us avoid reporting a value at all (not even an
empty one). On a spot check no tests failed with this over ra_serf,
even when I made the new block unconditional.

What should we do when an attempt to compute a liveprop's value fails?
Does the patch below makes sense? If not, what does?

Thanks,

Daniel

[[[
Index: subversion/mod_dav_svn/liveprops.c
===================================================================
--- subversion/mod_dav_svn/liveprops.c (revision 1291655)
+++ subversion/mod_dav_svn/liveprops.c (working copy)
@@ -761,13 +761,24 @@ insert_prop_internal(const dav_resource *resource,
     }
 
   /* assert: value != NULL */
 
   /* get the information and global NS index for the property */
   global_ns = dav_get_liveprop_info(propid, &dav_svn__liveprop_group, &info);
 
   /* assert: info != NULL && info->name != NULL */
 
- if (what == DAV_PROP_INSERT_NAME
+ if (value == error_value) {
+ /* If we ran into an error computing the live prop, only claim
+ * the property is recognized (without making any claims as to the
+ * value, empty or otherwise), and set the (ignored-by-all-callers)
+ * return value accordingly. */
+ s = apr_psprintf(result_pool,
+ "<D:supported-live-property D:name=\"%s\" "
+ "D:namespace=\"%s\"/>" DEBUG_CR,
+ info->name, namespace_uris[info->ns]);
+ what = DAV_PROP_INSERT_SUPPORTED;
+ }
+ else if (what == DAV_PROP_INSERT_NAME
       || (what == DAV_PROP_INSERT_VALUE && *value == '\0')) {
     s = apr_psprintf(result_pool, "<lp%d:%s/>" DEBUG_CR, global_ns,
                      info->name);
]]]
Received on 2012-02-21 12:08:37 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.