httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1748047 - in /httpd/httpd/trunk: CHANGES include/ap_mmn.h modules/dav/main/mod_dav.c modules/dav/main/mod_dav.h
Date Sun, 12 Jun 2016 20:23:21 GMT
Author: minfrin
Date: Sun Jun 12 20:23:21 2016
New Revision: 1748047

URL: http://svn.apache.org/viewvc?rev=1748047&view=rev
Log:
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.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/include/ap_mmn.h
    httpd/httpd/trunk/modules/dav/main/mod_dav.c
    httpd/httpd/trunk/modules/dav/main/mod_dav.h

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1748047&r1=1748046&r2=1748047&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Jun 12 20:23:21 2016
@@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) 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.
+     [Jari Urpalainen <jari.urpalainen nokia.com>, Graham Leggett]
+
   *) mod_dav: Add dav_get_provider_name() function to obtain the name
      of the provider from mod_dav.
      [Jari Urpalainen <jari.urpalainen nokia.com>]

Modified: httpd/httpd/trunk/include/ap_mmn.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_mmn.h?rev=1748047&r1=1748046&r2=1748047&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_mmn.h (original)
+++ httpd/httpd/trunk/include/ap_mmn.h Sun Jun 12 20:23:21 2016
@@ -526,6 +526,10 @@
  * 20160315.3 (2.5.0-dev)  Add childtags to dav_error.
  * 20160608.1 (2.5.0-dev)  Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n]()
  * 20160608.2 (2.5.0-dev)  Add dav_get_provider_name.
+ * 20160608.3 (2.5.0-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 0x41503235UL /* "AP25" */
@@ -533,7 +537,7 @@
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
 #define MODULE_MAGIC_NUMBER_MAJOR 20160608
 #endif
-#define MODULE_MAGIC_NUMBER_MINOR 2                 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 3                 /* 0...n */
 
 /**
  * Determine if the server's current MODULE_MAGIC_NUMBER is at least a

Modified: httpd/httpd/trunk/modules/dav/main/mod_dav.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/main/mod_dav.c?rev=1748047&r1=1748046&r2=1748047&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/main/mod_dav.c (original)
+++ httpd/httpd/trunk/modules/dav/main/mod_dav.c Sun Jun 12 20:23:21 2016
@@ -443,10 +443,10 @@ static const char *dav_xml_escape_uri(ap
    [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_re
    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_bu
 }
 
 /* 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_multistat
     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,
  *   - 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);
@@ -2178,8 +2178,8 @@ static int dav_method_propfind(request_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;
@@ -2239,7 +2239,8 @@ static apr_text * dav_failed_proppatch(a
     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;

Modified: httpd/httpd/trunk/modules/dav/main/mod_dav.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/main/mod_dav.h?rev=1748047&r1=1748046&r2=1748047&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/main/mod_dav.h (original)
+++ httpd/httpd/trunk/modules/dav/main/mod_dav.h Sun Jun 12 20:23:21 2016
@@ -185,6 +185,23 @@ DAV_DECLARE(dav_error*) dav_push_error(a
 */
 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,



Mime
View raw message