From 23c0524c96549564d48fe434223302824a172c0d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 19 Nov 2018 15:05:51 +0800 Subject: [PATCH] crimson/net: define an alias of seastar::stop_iteration Signed-off-by: Kefu Chai --- src/crimson/net/SocketConnection.cc | 12 +++++------- src/crimson/net/SocketConnection.h | 4 +++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index c9eae3a94331c..b98fb6b7545db 100644 --- a/src/crimson/net/SocketConnection.cc +++ b/src/crimson/net/SocketConnection.cc @@ -79,24 +79,22 @@ void SocketConnection::read_tags_until_next_message() switch (buf[0]) { case CEPH_MSGR_TAG_MSG: // stop looping and notify read_header() - return seastar::make_ready_future( - seastar::stop_iteration::yes); + return seastar::make_ready_future(stop_t::yes); case CEPH_MSGR_TAG_ACK: return handle_ack(); case CEPH_MSGR_TAG_KEEPALIVE: break; case CEPH_MSGR_TAG_KEEPALIVE2: return handle_keepalive2() - .then([this] { return seastar::stop_iteration::no; }); + .then([this] { return stop_t::no; }); case CEPH_MSGR_TAG_KEEPALIVE2_ACK: return handle_keepalive2_ack() - .then([this] { return seastar::stop_iteration::no; }); + .then([this] { return stop_t::no; }); case CEPH_MSGR_TAG_CLOSE: std::cout << "close" << std::endl; break; } - return seastar::make_ready_future( - seastar::stop_iteration::no); + return seastar::make_ready_future(stop_t::no); }); }).handle_exception_type([this] (const std::system_error& e) { if (e.code() == error::read_eof) { @@ -115,7 +113,7 @@ seastar::future SocketConnection::handle_ack() .then([this] (auto buf) { auto seq = reinterpret_cast(buf.get()); discard_up_to(&sent, *seq); - return seastar::stop_iteration::no; + return stop_t::no; }); } diff --git a/src/crimson/net/SocketConnection.h b/src/crimson/net/SocketConnection.h index 87c8e5d123277..c9d3e3c0e9a23 100644 --- a/src/crimson/net/SocketConnection.h +++ b/src/crimson/net/SocketConnection.h @@ -27,6 +27,8 @@ class AuthSessionHandler; namespace ceph::net { +using stop_t = seastar::stop_iteration; + class SocketMessenger; class SocketConnection; using SocketConnectionRef = boost::intrusive_ptr; @@ -99,7 +101,7 @@ class SocketConnection : public Connection { seastar::future<> maybe_throttle(); void read_tags_until_next_message(); - seastar::future handle_ack(); + seastar::future handle_ack(); /// becomes available when handshake completes, and when all previous messages /// have been sent to the output stream. send() chains new messages as -- 2.39.5