]> git.apps.os.sepia.ceph.com Git - ceph-ci.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>
Fri, 10 Nov 2017 04:20:43 +0000 (23:20 -0500)
commit6fbd3f358a17debea8c04f976946d5f245576f31
tree8650d3f3b2573e23b20454f39de159fa631f015f
parentcbf06de900eb16183ce1a6cc1f0f91c60a92a095
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>
src/rgw/rgw_asio_client.cc
src/rgw/rgw_common.h
src/rgw/rgw_env.cc