]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Updated version of civetweb. 11343/head
authorMarcus Watts <mwatts@redhat.com>
Tue, 1 Mar 2016 08:22:19 +0000 (03:22 -0500)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 3 Nov 2016 20:11:54 +0000 (13:11 -0700)
Fixes here:
Pull civetweb from new branch/commit.
Build civetweb.c w/ USE_IPV6 (w/o depending on extra ceph-only build
logic inside of civetweb.)
Make several things "const" to please the compiler.
Remap port string at '+' -> ,; to avoid , overload.
Use new civetweb options validate_http_method=no canonicalize_url_path=no

Signed-off-by: Marcus Watts <mwatts@redhat.com>
CMakeLists.txt
src/CMakeLists.txt
src/civetweb
src/rgw/rgw_civetweb.cc
src/rgw/rgw_civetweb_frontend.cc

index da7d3cbd8a2a9f65c89cbeeb77e13be1c0250b4e..2a77d0bf92f2b963babb4279e602fe53d65c2d4b 100644 (file)
@@ -376,6 +376,12 @@ option(DEBUG_GATHER "C_Gather debugging is enabled" ON)
 option(HAVE_LIBZFS "LibZFS is enabled" OFF)
 option(ENABLE_COVERAGE "Coverage is enabled" OFF)
 option(PG_DEBUG_REFS "PG Ref debugging is enabled" OFF)
+# we want to include civetweb.h as "civetweb/civetweb.h".  Make it so.
+execute_process(
+COMMAND rm -f "${CMAKE_BINARY_DIR}/src/include/civetweb"
+COMMAND mkdir -p "${CMAKE_BINARY_DIR}/src/include"
+COMMAND ln -s "${CMAKE_SOURCE_DIR}/src/civetweb/include"
+        "${CMAKE_BINARY_DIR}/src/include/civetweb")
 
 option(WITH_TESTS "enable the build of ceph-test package scripts/binaries" ON)
 
index 833a4280e8002c315567d422aa9351ef802a1814..bef81e1276421c728fd52feb2260f121b4737331 100644 (file)
@@ -855,6 +855,8 @@ if(WITH_RADOSGW)
   add_library(civetweb_common_objs OBJECT ${civetweb_common_files})
   target_include_directories(civetweb_common_objs PUBLIC
        "${CMAKE_SOURCE_DIR}/src/civetweb/include")
+  set_property(TARGET civetweb_common_objs
+    APPEND PROPERTY COMPILE_DEFINITIONS USE_IPV6=1)
   if(HAVE_SSL)
     set_property(TARGET civetweb_common_objs
       APPEND PROPERTY COMPILE_DEFINITIONS NO_SSL_DL=1)
index e12494070432b85d5ffce7dece81c0baad457a5f..cc0dfa11dadfca8a7021687aa537a3d377f244cb 160000 (submodule)
@@ -1 +1 @@
-Subproject commit e12494070432b85d5ffce7dece81c0baad457a5f
+Subproject commit cc0dfa11dadfca8a7021687aa537a3d377f244cb
index c92eb843a830953194ff83fee8a8ce583a9d804c..2ed6fa7acfc5dfcec996d6cf5d50eb2f8141bc6b 100644 (file)
@@ -60,14 +60,14 @@ size_t RGWCivetWeb::complete_request()
 void RGWCivetWeb::init_env(CephContext *cct)
 {
   env.init(cct);
-  struct mg_request_info* const info = mg_get_request_info(conn);
+  const struct mg_request_info* info = mg_get_request_info(conn);
 
   if (! info) {
     return;
   }
 
   for (int i = 0; i < info->num_headers; i++) {
-    struct mg_request_info::mg_header* const header = &info->http_headers[i];
+    const struct mg_request_info::mg_header* header = &info->http_headers[i];
     const boost::string_ref name(header->name);
     const auto& value = header->value;
 
index de9ea6526911360824608c8d169c6027b5098dce..17686f6e641aa6748bdb96620d0ccf579c07ca82 100644 (file)
@@ -13,7 +13,7 @@
 
 static int civetweb_callback(struct mg_connection* conn)
 {
-  struct mg_request_info* const req_info = mg_get_request_info(conn);
+  const struct mg_request_info* const req_info = mg_get_request_info(conn);
   return static_cast<RGWCivetWebFrontend *>(req_info->user_data)->process(conn);
 }
 
@@ -51,6 +51,8 @@ int RGWCivetWebFrontend::run()
   set_conf_default(conf_map, "decode_url", "no");
   set_conf_default(conf_map, "enable_keep_alive", "yes");
   conf_map["listening_ports"] = conf->get_val("port", "80");
+  set_conf_default(conf_map, "validate_http_method", "no");
+  set_conf_default(conf_map, "canonicalize_url_path", "no");
 
   /* Set run_as_user. This will cause civetweb to invoke setuid() and setgid()
    * based on pw_uid and pw_gid obtained from pw_name. */