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);
]]]

Reply via email to