You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joe Orton <jo...@redhat.com> on 2005/06/20 13:42:11 UTC

[PATCH] more ra_dav error handling tweaks

This fixes two cases where a SIGINT could cause a bad error message with 
neon 0.25.x; e.g. "blah blah blah: 200 OK" rather than "Caught signal".  
Currently running through davautocheck; manually confirmed the "svn log" 
case.

* subversion/libsvn_ra_dav/log.c (svn_ra_dav__get_log): Return error 
stored in baton in preference to error returned by 
svn_ra_dav__parsed_request_compat; fix possible error leak.

* subversion/libsvn_ra_dav/merge.c (svn_ra_dav__merge_activity):
Likewise.

Index: subversion/libsvn_ra_dav/merge.c
===================================================================
--- subversion/libsvn_ra_dav/merge.c	(revision 15103)
+++ subversion/libsvn_ra_dav/merge.c	(working copy)
@@ -2,7 +2,7 @@
  * merge.c :  routines for performing a MERGE server requests
  *
  * ====================================================================
- * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2005 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -654,6 +654,7 @@
   const char *body;
   apr_hash_t *extra_headers = NULL;
   svn_stringbuf_t *lockbuf = svn_stringbuf_create("", pool);
+  svn_error_t *err;
 
   mc.pool = pool;
   mc.scratchpool = svn_pool_create (pool);
@@ -707,16 +708,23 @@
                       "</D:merge>",
                       activity_url, lockbuf->data);
 
-  SVN_ERR( svn_ra_dav__parsed_request_compat(ras->sess, "MERGE", repos_url,
-                                             body, 0, NULL, merge_elements,
-                                             validate_element, start_element,
-                                             end_element, &mc, extra_headers,
-                                             NULL, FALSE, pool) );
+  err = svn_ra_dav__parsed_request_compat(ras->sess, "MERGE", repos_url,
+                                          body, 0, NULL, merge_elements,
+                                          validate_element, start_element,
+                                          end_element, &mc, extra_headers,
+                                          NULL, FALSE, pool);
   
   /* is there an error stashed away in our context? */
-  if (mc.err != NULL)
-    return mc.err;
+  if (mc.err)
+    {
+      if (err)
+        svn_error_clear(err);
 
+      return mc.err;
+    }
+  else if (err)
+    return err;
+
   /* return some commit properties to the caller. */
   if (new_rev)
     *new_rev = mc.rev;
Index: subversion/libsvn_ra_dav/log.c
===================================================================
--- subversion/libsvn_ra_dav/log.c	(revision 15103)
+++ subversion/libsvn_ra_dav/log.c	(working copy)
@@ -2,7 +2,7 @@
  * log.c :  routines for requesting and parsing log reports
  *
  * ====================================================================
- * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
+ * Copyright (c) 2000-2005 CollabNet.  All rights reserved.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution.  The terms
@@ -322,6 +322,7 @@
   svn_string_t bc_url, bc_relative;
   const char *final_bc_url;
   svn_revnum_t use_rev;
+  svn_error_t *err;
 
   /* ### todo: I don't understand why the static, file-global
      variables shared by update and status are called `report_head'
@@ -423,26 +424,31 @@
                                             ras->pool);
 
 
-  SVN_ERR( svn_ra_dav__parsed_request_compat(ras->sess,
-                                             "REPORT",
-                                             final_bc_url,
-                                             request_body->data,
-                                             0,  /* ignored */
-                                             NULL,
-                                             log_report_elements, 
-                                             log_validate,
-                                             log_start_element,
-                                             log_end_element,
-                                             &lb,
-                                             NULL, 
-                                             NULL,
-                                             FALSE,
-                                             ras->pool) );
-
+  err = svn_ra_dav__parsed_request_compat(ras->sess,
+                                          "REPORT",
+                                          final_bc_url,
+                                          request_body->data,
+                                          0,  /* ignored */
+                                          NULL,
+                                          log_report_elements, 
+                                          log_validate,
+                                          log_start_element,
+                                          log_end_element,
+                                          &lb,
+                                          NULL, 
+                                          NULL,
+                                          FALSE,
+                                          ras->pool);
+  
   if (lb.err)
-    return lb.err;
+    {
+      if (err)
+        svn_error_clear(err);
 
+      return lb.err;
+    }
+
   svn_pool_destroy (lb.subpool);
 
-  return SVN_NO_ERROR;
+  return err;
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org