]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1748047 from trunk:
authorYann Ylavic <ylavic@apache.org>
Tue, 16 Aug 2016 23:22:39 +0000 (23:22 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 16 Aug 2016 23:22:39 +0000 (23:22 +0000)
mod_dav: Add dav_begin_multistatus, dav_send_one_response,
dav_finish_multistatus, dav_send_multistatus, dav_handle_err,
dav_failed_proppatch, dav_success_proppatch to mod_dav.h.

Submitted by: minfrin
Reviewed by: minfrin, jim, ylavic

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

CHANGES
STATUS
include/ap_mmn.h
modules/dav/main/mod_dav.c
modules/dav/main/mod_dav.h

diff --git a/CHANGES b/CHANGES
index fa5fa5251c5bf45591b37e3399e410843d7efbf5..e31f69186ee4c596af7ebe66ae9575fa938b7dc6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,9 @@ Changes with Apache 2.4.24
   *) core: CVE-2016-5387: Mitigate [f]cgi "httpoxy" issues.
      [Dominic Scheirlinck <dominic vendhq.com>, Yann Ylavic]
 
+  *) mod_dav: Add dav_get_provider_name() function to obtain the name
+     of the provider from mod_dav.  [Graham Leggett]
+
   *) mod_dav: Add support for childtags to dav_error.
      [Jari Urpalainen <jari.urpalainen nokia.com>]
 
diff --git a/STATUS b/STATUS
index 680f8ec1ed08cf1ff72dea3d5bc2726bcd3153fc..aef4d01b330517b5fd28e096839d8bd8fe36a732 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -117,13 +117,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_dav: Add dav_begin_multistatus, dav_send_one_response,
-     dav_finish_multistatus, dav_send_multistatus, dav_handle_err, 
-     dav_failed_proppatch, dav_success_proppatch to mod_dav.h.
-     trunk patch: http://svn.apache.org/r1748047
-     2.4.x: trunk works modulo CHANGES/MMN
-     +1: minfrin, jim, ylavic
-
   *) mod_proxy: Correctly consider error response codes by the backend when
      processing failonstatus. PR 59869
       Trunk version of patch:
index 0a3e8f50e0fc5898d347849e481da0eb83150ddf..01878cdef3d005df09d912d9b0147ddab07bcc1a 100644 (file)
  * 20120211.60 (2.4.21-dev) Add dav_get_provider_name.
  * 20120211.61 (2.4.21-dev) Add ap_cstr_casecmp[n]() - placeholder of apr_ fns
  * 20120211.62 (2.4.24-dev) Add childtags to dav_error.
+ * 20120211.63 (2.4.24-dev) Add dav_begin_multistatus, dav_send_one_response,
+ *                          dav_finish_multistatus, dav_send_multistatus,
+ *                          dav_handle_err, dav_failed_proppatch,
+ *                          dav_success_proppatch.
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20120211
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 62                   /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 63                   /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a
index dc914199116e433934649b18a1b77e1dc1d848e6..01a7d29300e8e68580bcead7e691129b1d01cff9 100644 (file)
@@ -443,10 +443,10 @@ static const char *dav_xml_escape_uri(apr_pool_t *p, const char *uri)
    [Presumably the <multistatus> tag has already been written;  this
    routine is shared by dav_send_multistatus and dav_stream_response.]
 */
-static void dav_send_one_response(dav_response *response,
-                                  apr_bucket_brigade *bb,
-                                  ap_filter_t *output,
-                                  apr_pool_t *pool)
+DAV_DECLARE(void) dav_send_one_response(dav_response *response,
+                                        apr_bucket_brigade *bb,
+                                        ap_filter_t *output,
+                                        apr_pool_t *pool)
 {
     apr_text *t = NULL;
 
@@ -505,9 +505,9 @@ static void dav_send_one_response(dav_response *response,
    response and write <multistatus> tag into BB, destined for
    R->output_filters.  Use xml NAMESPACES in initial tag, if
    non-NULL. */
-static void dav_begin_multistatus(apr_bucket_brigade *bb,
-                                  request_rec *r, int status,
-                                  apr_array_header_t *namespaces)
+DAV_DECLARE(void) dav_begin_multistatus(apr_bucket_brigade *bb,
+                                        request_rec *r, int status,
+                                        apr_array_header_t *namespaces)
 {
     /* Set the correct status and Content-Type */
     r->status = status;
@@ -530,8 +530,8 @@ static void dav_begin_multistatus(apr_bucket_brigade *bb,
 }
 
 /* Finish a multistatus response started by dav_begin_multistatus: */
-static apr_status_t dav_finish_multistatus(request_rec *r,
-                                           apr_bucket_brigade *bb)
+DAV_DECLARE(apr_status_t) dav_finish_multistatus(request_rec *r,
+                                                 apr_bucket_brigade *bb)
 {
     apr_bucket *b;
 
@@ -545,9 +545,9 @@ static apr_status_t dav_finish_multistatus(request_rec *r,
     return ap_pass_brigade(r->output_filters, bb);
 }
 
-static void dav_send_multistatus(request_rec *r, int status,
-                                 dav_response *first,
-                                 apr_array_header_t *namespaces)
+DAV_DECLARE(void) dav_send_multistatus(request_rec *r, int status,
+                                       dav_response *first,
+                                       apr_array_header_t *namespaces)
 {
     apr_pool_t *subpool;
     apr_bucket_brigade *bb = apr_brigade_create(r->pool,
@@ -600,8 +600,8 @@ static void dav_log_err(request_rec *r, dav_error *err, int level)
  *   - repos_hooks->copy_resource
  *   - vsn_hooks->update
  */
-static int dav_handle_err(request_rec *r, dav_error *err,
-                          dav_response *response)
+DAV_DECLARE(int) dav_handle_err(request_rec *r, dav_error *err,
+                                dav_response *response)
 {
     /* log the errors */
     dav_log_err(r, err, APLOG_ERR);
@@ -2173,8 +2173,8 @@ static int dav_method_propfind(request_rec *r)
     return DONE;
 }
 
-static apr_text * dav_failed_proppatch(apr_pool_t *p,
-                                      apr_array_header_t *prop_ctx)
+DAV_DECLARE(apr_text *) dav_failed_proppatch(apr_pool_t *p,
+                                             apr_array_header_t *prop_ctx)
 {
     apr_text_header hdr = { 0 };
     int i = prop_ctx->nelts;
@@ -2234,7 +2234,8 @@ static apr_text * dav_failed_proppatch(apr_pool_t *p,
     return hdr.first;
 }
 
-static apr_text * dav_success_proppatch(apr_pool_t *p, apr_array_header_t *prop_ctx)
+DAV_DECLARE(apr_text *) dav_success_proppatch(apr_pool_t *p,
+                                              apr_array_header_t *prop_ctx)
 {
     apr_text_header hdr = { 0 };
     int i = prop_ctx->nelts;
index 6104ae6997e75e0ba293d6c0d88f45371921dc98..93b9b4e27d0a8538bcec800aee1d2313f2b849b3 100644 (file)
@@ -185,6 +185,23 @@ DAV_DECLARE(dav_error*) dav_push_error(apr_pool_t *p, int status, int error_id,
 */
 DAV_DECLARE(dav_error*) dav_join_error(dav_error* dest, dav_error* src);
 
+typedef struct dav_response dav_response;
+
+/*
+** dav_handle_err()
+**
+** Handle the standard error processing. <err> must be non-NULL.
+**
+** <response> is set by the following:
+**   - dav_validate_request()
+**   - dav_add_lock()
+**   - repos_hooks->remove_resource
+**   - repos_hooks->move_resource
+**   - repos_hooks->copy_resource
+**   - vsn_hooks->update
+*/
+DAV_DECLARE(int) dav_handle_err(request_rec *r, dav_error *err,
+                                dav_response *response);
 
 /* error ID values... */
 
@@ -517,6 +534,41 @@ typedef enum {
 #define DAV_STYLE_RFC822        2
 #define DAV_TIMEBUF_SIZE        30
 
+/* Write a complete RESPONSE object out as a <DAV:response> xml
+ * element.  Data is sent into brigade BB, which is auto-flushed into
+ * OUTPUT filter stack.  Use POOL for any temporary allocations.
+ *
+ * [Presumably the <multistatus> tag has already been written;  this
+ * routine is shared by dav_send_multistatus and dav_stream_response.]
+ */
+DAV_DECLARE(void) dav_send_one_response(dav_response *response,
+                                        apr_bucket_brigade *bb,
+                                        ap_filter_t *output,
+                                        apr_pool_t *pool);
+
+/* Factorized helper function: prep request_rec R for a multistatus
+ * response and write <multistatus> tag into BB, destined for
+ * R->output_filters.  Use xml NAMESPACES in initial tag, if
+ * non-NULL.
+ */
+DAV_DECLARE(void) dav_begin_multistatus(apr_bucket_brigade *bb,
+                                        request_rec *r, int status,
+                                        apr_array_header_t *namespaces);
+
+/* Finish a multistatus response started by dav_begin_multistatus: */
+DAV_DECLARE(apr_status_t) dav_finish_multistatus(request_rec *r,
+                                                 apr_bucket_brigade *bb);
+
+/* Send a multistatus response */
+DAV_DECLARE(void) dav_send_multistatus(request_rec *r, int status,
+                                       dav_response *first,
+                                       apr_array_header_t *namespaces);
+
+DAV_DECLARE(apr_text *) dav_failed_proppatch(apr_pool_t *p,
+                                             apr_array_header_t *prop_ctx);
+DAV_DECLARE(apr_text *) dav_success_proppatch(apr_pool_t *p,
+                                              apr_array_header_t *prop_ctx);
+
 DAV_DECLARE(int) dav_get_depth(request_rec *r, int def_depth);
 
 DAV_DECLARE(int) dav_validate_root(const apr_xml_doc *doc,