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: beast frontend can listen on multiple endpoints #20188

Merged
merged 3 commits into from Feb 5, 2018

Conversation

cbodley
Copy link
Contributor

@cbodley cbodley commented Jan 30, 2018

extends the frontend configuration to store options in a multimap, so that port and endpoint can be specified multiple times. the beast frontend creates a separate Listener for each port/endpoint given, and this Listener instance is passed as an extra argument when accept()ing new connections. the civetweb frontend also supports multiple port options

Fixes: http://tracker.ceph.com/issues/22779

this allows us to configure multiple values for a given key without
resorting to string formatting to cram them into a single key/value pair

ex. port=80 port=443s instead of port=80+443s

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
return port;
}

tcp::endpoint parse_endpoint(std::experimental::string_view input,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does Ceph have any policy on std::experimental? What about using boost::string_view instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, thanks for reminding me about this part

i had found that boost::asio::ip::make_address() wouldn't accept boost::string_view or std::string_view, so this was the only form that would compile. but now that i look closer (http://www.boost.org/doc/libs/1_66_0/boost/asio/detail/string_view.hpp), there are typedefs for string_view/basic_string_view in namespace boost::asio that i can use instead

rgw_frontends options port= and endpoint= can be given multiple times,
and the beast frontend will listen on each endpoint

Fixes: http://tracker.ceph.com/issues/22779

Signed-off-by: Casey Bodley <cbodley@redhat.com>
@cbodley
Copy link
Contributor Author

cbodley commented Feb 1, 2018

thanks @rzarzynski, updated to use the same boost::asio::string_view typedef used by boost::asio::ip::make_address()

Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

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

LGTM.

@cbodley cbodley merged commit 41229b4 into ceph:master Feb 5, 2018
@cbodley cbodley deleted the wip-rgw-frontend-multimap branch February 5, 2018 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants