You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2013/04/19 06:00:52 UTC

svn commit: r1469680 - in /subversion/branches/1.8.x: ./ STATUS subversion/mod_dav_svn/repos.c

Author: svn-role
Date: Fri Apr 19 04:00:52 2013
New Revision: 1469680

URL: http://svn.apache.org/r1469680
Log:
Merge r1468347 from trunk:

 * r1468347
   Handle POST errors like MKACTIVITY errors.
   Justification:
     Consistent error reporting for v1 and v2 protocols.
   Votes:
     +1: philip, rhuijben, brane

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1468347

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1469680&r1=1469679&r2=1469680&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Fri Apr 19 04:00:52 2013
@@ -65,13 +65,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1468347
-   Handle POST errors like MKACTIVITY errors.
-   Justification:
-     Consistent error reporting for v1 and v2 protocols.
-   Votes:
-     +1: philip, rhuijben, brane
-
  * r1468565
    Use correct plural localisation for conflict summary messages.
    Justification:

Modified: subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c?rev=1469680&r1=1469679&r2=1469680&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c Fri Apr 19 04:00:52 2013
@@ -4463,6 +4463,32 @@ handle_post_request(request_rec *r,
                             "Unsupported skel POST request flavor.");
 }
 
+
+/* A stripped down version of mod_dav's dav_handle_err so that POST
+   errors, which are not passed via mod_dav, are handled in the same
+   way as errors for requests that are passed via mod_dav. */
+static int
+handle_err(request_rec *r, dav_error *err)
+{
+  dav_error *stackerr = err;
+
+  dav_svn__log_err(r, err, APLOG_ERR);
+
+  /* our error messages are safe; tell Apache this */
+  apr_table_setn(r->notes, "verbose-error-to", "*");
+
+  /* We might be able to generate a standard <D:error> response.
+     Search the error stack for an errortag. */
+  while (stackerr != NULL && stackerr->tagname == NULL)
+    stackerr = stackerr->prev;
+
+  if (stackerr != NULL && stackerr->tagname != NULL)
+    return dav_svn__error_response_tag(r, stackerr);
+
+  return err->status;
+}
+
+
 int dav_svn__method_post(request_rec *r)
 {
   dav_resource *resource;
@@ -4495,9 +4521,8 @@ int dav_svn__method_post(request_rec *r)
   if (derr)
     {
       /* POST is not a DAV method and so mod_dav isn't involved and
-         won't log this error.  Do it explicitly. */
-      dav_svn__log_err(r, derr, APLOG_ERR);
-      return dav_svn__error_response_tag(r, derr);
+         won't handle this error.  Do it explicitly. */
+      return handle_err(r, derr);
     }
 
   return OK;