]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: RGWEnv::set() takes std::string
authorCasey Bodley <cbodley@redhat.com>
Fri, 10 Nov 2017 04:20:40 +0000 (23:20 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 8 Jan 2018 21:30:18 +0000 (16:30 -0500)
commitacb49cfc8f2cc79b0bf38ab0a95c07398a9c5061
treef4c608f2e4305d6d2ad1e1cd9ac09f88ae695c28
parent0f08d3d9a53f1cb1f1ea13181a3c96a14f7b65dd
rgw: RGWEnv::set() takes std::string

the beast frontend will either pass a string_ref or a string_view,
depending on the boost version. we can't overload RGWEnv::set() for
both, because a call to env.set("literal") would be ambiguous

both string_ref and string_view have a to_string() member function, so
RGWEnv::set() now takes a std::string by value and moves it into the
map. this involes a single string copy, whether we pass a temporary
std::string (in beast) or a const char* (in civetweb)

Fixes: http://tracker.ceph.com/issues/22101
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 6fbd3f358a17debea8c04f976946d5f245576f31)
src/rgw/rgw_asio_client.cc
src/rgw/rgw_common.h
src/rgw/rgw_env.cc