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: RGWEnv::set() takes std::string #18866

Merged
merged 1 commit into from Nov 14, 2017
Merged

rgw: RGWEnv::set() takes std::string #18866

merged 1 commit into from Nov 14, 2017

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Nov 10, 2017

fixes a compilation failure with boost version 1.64 or later
Fixes: http://tracker.ceph.com/issues/22101

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(const char*) 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)

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>
@wjwithagen
Copy link
Contributor

@cbodley
Ah, sorry I'm rather busy with real life and $work. So have not spent much time working on Ceph.
Will put the diff in the test-env. and will let you know.

Copy link
Contributor

@wjwithagen wjwithagen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbodley
Copy link
Contributor Author

cbodley commented Nov 13, 2017

thanks @wjwithagen!

@yuriw
Copy link
Contributor

yuriw commented Nov 13, 2017

@yuriw yuriw merged commit f8b7c3e into ceph:master Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants