You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2021/09/26 14:18:55 UTC

svn commit: r1893656 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS modules/dav/main/mod_dav.c

Author: minfrin
Date: Sun Sep 26 14:18:55 2021
New Revision: 1893656

URL: http://svn.apache.org/viewvc?rev=1893656&view=rev
Log:
Backport:

*) 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


Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/CHANGES
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1893589

Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1893656&r1=1893655&r2=1893656&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Sun Sep 26 14:18:55 2021
@@ -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]
 

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1893656&r1=1893655&r2=1893656&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Sun Sep 26 14:18:55 2021
@@ -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 ]

Modified: httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c?rev=1893656&r1=1893655&r2=1893656&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c (original)
+++ httpd/httpd/branches/2.4.x/modules/dav/main/mod_dav.c Sun Sep 26 14:18:55 2021
@@ -4329,10 +4329,32 @@ static int dav_method_report(request_rec
     /* 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
         /* 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;