]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport:
authorGraham Leggett <minfrin@apache.org>
Sun, 26 Sep 2021 14:18:55 +0000 (14:18 +0000)
committerGraham Leggett <minfrin@apache.org>
Sun, 26 Sep 2021 14:18:55 +0000 (14:18 +0000)
*) mod_dav: Correctly handle errors returned by dav providers on REPORT
   requests.
   Trunk version of patch:
      https://svn.apache.org/r1893589
   Backport version for 2.4.x of patch:
    Trunk version of patch works
    svn merge -c 1893589 ^/httpd/httpd/trunk .
   +1: rpluem, minfrin, ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893656 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/dav/main/mod_dav.c

diff --git a/CHANGES b/CHANGES
index 2bcf3895016e4a37527e2f6e421ac175cc646034..5c2954103260ce616880ba6af2d10893ceabc2c6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.50
 
+  *) mod_dav: Correctly handle errors returned by dav providers on REPORT
+     requests. [Ruediger Pluem]
+
   *) core: do not install core input/output filters on secondary
      connections. [Stefan Eissing]
 
diff --git a/STATUS b/STATUS
index 0afaf501bf0c1692880c0f1fadf25f6574d8e0fb..5d2353eba5eac3d5bcf02b2653974e58be8ee640 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -142,14 +142,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_dav: Correctly handle errors returned by dav providers on REPORT
-     requests.
-     Trunk version of patch:
-        https://svn.apache.org/r1893589
-     Backport version for 2.4.x of patch:
-      Trunk version of patch works
-      svn merge -c 1893589 ^/httpd/httpd/trunk .
-     +1: rpluem, minfrin, ylavic
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 3ba1f8cad7066409e06537411ced74ccbef13ca9..2cbfc06111af21fbcec9c56c3f264cf3964e03fa 100644 (file)
@@ -4329,10 +4329,32 @@ static int dav_method_report(request_rec *r)
     /* set up defaults for the report response */
     r->status = HTTP_OK;
     ap_set_content_type(r, DAV_XML_CONTENT_TYPE);
+    err = NULL;
 
     /* run report hook */
     result = dav_run_deliver_report(r, resource, doc,
             r->output_filters, &err);
+    if (err != NULL) {
+
+        if (! r->sent_bodyct) {
+          /* No data has been sent to client yet;  throw normal error. */
+          return dav_handle_err(r, err, NULL);
+        }
+
+        /* If an error occurred during the report delivery, there's
+           basically nothing we can do but abort the connection and
+           log an error.  This is one of the limitations of HTTP; it
+           needs to "know" the entire status of the response before
+           generating it, which is just impossible in these streamy
+           response situations. */
+        err = dav_push_error(r->pool, err->status, 0,
+                             "Provider encountered an error while streaming"
+                             " a REPORT response.", err);
+        dav_log_err(r, err, APLOG_ERR);
+        r->connection->aborted = 1;
+
+        return DONE;
+    }
     switch (result) {
     case OK:
         return DONE;
@@ -4340,27 +4362,7 @@ static int dav_method_report(request_rec *r)
         /* No one handled the report */
         return HTTP_NOT_IMPLEMENTED;
     default:
-        if ((err) != NULL) {
-
-            if (! r->sent_bodyct) {
-              /* No data has been sent to client yet;  throw normal error. */
-              return dav_handle_err(r, err, NULL);
-            }
-
-            /* If an error occurred during the report delivery, there's
-               basically nothing we can do but abort the connection and
-               log an error.  This is one of the limitations of HTTP; it
-               needs to "know" the entire status of the response before
-               generating it, which is just impossible in these streamy
-               response situations. */
-            err = dav_push_error(r->pool, err->status, 0,
-                                 "Provider encountered an error while streaming"
-                                 " a REPORT response.", err);
-            dav_log_err(r, err, APLOG_ERR);
-            r->connection->aborted = 1;
-
-            return DONE;
-        }
+        return DONE;
     }
 
     return DONE;