Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: civetweb fixes for v1.1 upgrade #21123

Merged
merged 4 commits into from Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions qa/tasks/s3tests.py
Expand Up @@ -248,10 +248,8 @@ def run_tests(ctx, config):
"""
assert isinstance(config, dict)
testdir = teuthology.get_testdir(ctx)
attrs = ["!fails_on_rgw", "!lifecycle_expiration"]
# beast parser is strict about unreadable headers
if ctx.rgw.frontend == 'beast':
attrs.append("!fails_strict_rfc2616")
# civetweb > 1.8 && beast parsers are strict on rfc2616
attrs = ["!fails_on_rgw", "!lifecycle_expiration", "!fails_strict_rfc2616"]
for client, client_config in config.iteritems():
(remote,) = ctx.cluster.only(client).remotes.keys()
args = [
Expand Down
9 changes: 9 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -1078,6 +1078,15 @@ if(WITH_RADOSGW)
APPEND PROPERTY COMPILE_DEFINITIONS CRYPTO_LIB="${LIBCRYPTO_SONAME}")
endif()

if (OPENSSL_FOUND)
# Use cmake to determine openssl version, a TODO is to make
# civetweb itself do this based on openssl_api_compat strings
if (NOT (OPENSSL_VERSION VERSION_LESS "1.1"))
message(STATUS "Setting civetweb to use OPENSSL >= 1.1")
set_property(TARGET civetweb_common_objs
APPEND PROPERTY COMPILE_DEFINITIONS OPENSSL_API_1_1=1)
endif()
endif(OPENSSL_FOUND)
add_subdirectory(rgw)

endif(WITH_RADOSGW)
Expand Down
2 changes: 1 addition & 1 deletion src/civetweb
Submodule civetweb updated 815 files
4 changes: 2 additions & 2 deletions src/rgw/rgw_civetweb.cc
Expand Up @@ -92,7 +92,7 @@ int RGWCivetWeb::init_env(CephContext *cct)
}

for (int i = 0; i < info->num_headers; i++) {
const struct mg_request_info::mg_header* header = &info->http_headers[i];
const auto header = &info->http_headers[i];

if (header->name == nullptr || header->value==nullptr) {
lderr(cct) << "client supplied malformatted headers" << dendl;
Expand Down Expand Up @@ -138,7 +138,7 @@ int RGWCivetWeb::init_env(CephContext *cct)
env.set("REQUEST_METHOD", info->request_method);
env.set("HTTP_VERSION", info->http_version);
env.set("REQUEST_URI", info->request_uri); // get the full uri, we anyway handle abs uris later
env.set("SCRIPT_URI", info->uri); /* FIXME */
env.set("SCRIPT_URI", info->local_uri);
if (info->query_string) {
env.set("QUERY_STRING", info->query_string);
}
Expand Down
1 change: 1 addition & 0 deletions src/rgw/rgw_civetweb_frontend.cc
Expand Up @@ -58,6 +58,7 @@ int RGWCivetWebFrontend::run()
set_conf_default(conf_map, "validate_http_method", "no");
set_conf_default(conf_map, "canonicalize_url_path", "no");
set_conf_default(conf_map, "enable_auth_domain_check", "no");
set_conf_default(conf_map, "allow_unicode_in_urls", "yes");

std::string listening_ports;
// support multiple port= entries
Expand Down