summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2018-10-09 09:17:06 +0200
committerKefu Chai <kchai@redhat.com>2018-10-09 11:39:39 +0200
commite9670e803569ec629d7f446469f38ca741fce568 (patch)
treee878d6c2c156528678035e8dcfa90962d1eb0dd1
parentcmake: disable libhwloc (diff)
downloadceph-e9670e803569ec629d7f446469f38ca741fce568.tar.xz
ceph-e9670e803569ec629d7f446469f38ca741fce568.zip
crimson/net: use std::option instead stdx::option<>
in upstream seastar, "SEASTAR_USE_STD_OPTIONAL_VARIANT_STRINGVIEW" is offered as an option. if it is set to "1", std::option is used instead of std::experimental::option. using std::option is more C++17 compliant and simpler. but we are using a seastar version based on https://github.com/hakuch/seastar/commits/jhk/better_cmake/v3 , which enables "SEASTAR_USE_STD_OPTIONAL_VARIANT_STRINGVIEW" by default, if C++17 is used. Signed-off-by: Kefu Chai <kchai@redhat.com>
-rw-r--r--src/crimson/net/SocketConnection.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc
index 9595cca9e1a..9c669b33228 100644
--- a/src/crimson/net/SocketConnection.cc
+++ b/src/crimson/net/SocketConnection.cc
@@ -248,14 +248,12 @@ seastar::future<MessageRef> SocketConnection::do_read_message()
seastar::future<MessageRef> SocketConnection::read_message()
{
- namespace stdx = std::experimental;
-
return seastar::repeat_until_value([this] {
return do_read_message()
- .then([this] (MessageRef msg) -> stdx::optional<MessageRef> {
+ .then([this] (MessageRef msg) -> std::optional<MessageRef> {
if (!update_rx_seq(msg->get_seq())) {
// skip this request and read the next
- return stdx::nullopt;
+ return {};
}
return msg;
});