ceph/0030-src-rgw-rgw_asio_client.cc.patch

62 lines
2.0 KiB
Diff
Raw Normal View History

--- ceph-18.0.0-2726-g7cea3740/src/rgw/rgw_asio_client.cc.orig 2023-03-14 18:46:02.037195570 -0400
+++ ceph-18.0.0-2726-g7cea3740/src/rgw/rgw_asio_client.cc 2023-03-14 18:55:14.446438244 -0400
@@ -39,11 +39,13 @@
const auto& value = header->value();
if (field == beast::http::field::content_length) {
- env.set("CONTENT_LENGTH", value.to_string());
+ std::string scratch{value.data(), value.size()};
+ env.set("CONTENT_LENGTH", scratch.c_str());
continue;
}
if (field == beast::http::field::content_type) {
- env.set("CONTENT_TYPE", value.to_string());
+ std::string scratch{value.data(), value.size()};
+ env.set("CONTENT_TYPE", scratch.c_str());
continue;
}
@@ -62,26 +64,37 @@
}
*dest = '\0';
- env.set(buf, value.to_string());
+ std::string scratch{value.data(), value.size()};
+ env.set(buf, scratch.c_str());
}
int major = request.version() / 10;
int minor = request.version() % 10;
env.set("HTTP_VERSION", std::to_string(major) + '.' + std::to_string(minor));
- env.set("REQUEST_METHOD", request.method_string().to_string());
+ {
+ std::string scratch {request.method_string().data(),request.method_string().size()};
+ env.set("REQUEST_METHOD", scratch.c_str());
+ }
// split uri from query
auto uri = request.target();
auto pos = uri.find('?');
if (pos != uri.npos) {
auto query = uri.substr(pos + 1);
- env.set("QUERY_STRING", query.to_string());
+ std::string scratch{query.data(), query.size()};
+ env.set("QUERY_STRING", scratch.c_str());
uri = uri.substr(0, pos);
}
- env.set("SCRIPT_URI", uri.to_string());
+ {
+ std::string scratch {uri.data(), uri.size()};
+ env.set("SCRIPT_URI", scratch.c_str());
+ }
- env.set("REQUEST_URI", request.target().to_string());
+ {
+ std::string scratch {request.target().data(), request.target().size()};
+ env.set("REQUEST_URI", scratch.c_str());
+ }
char port_buf[16];
snprintf(port_buf, sizeof(port_buf), "%d", local_endpoint.port());