crimson/net: define an alias of seastar::stop_iteration

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2018-11-19 15:05:51 +08:00 committed by Yingxin
parent c014f702d9
commit 23c0524c96
2 changed files with 8 additions and 8 deletions

View File

@ -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>(
seastar::stop_iteration::yes);
return seastar::make_ready_future<stop_t>(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>(
seastar::stop_iteration::no);
return seastar::make_ready_future<stop_t>(stop_t::no);
});
}).handle_exception_type([this] (const std::system_error& e) {
if (e.code() == error::read_eof) {
@ -115,7 +113,7 @@ seastar::future<seastar::stop_iteration> SocketConnection::handle_ack()
.then([this] (auto buf) {
auto seq = reinterpret_cast<const ceph_le64*>(buf.get());
discard_up_to(&sent, *seq);
return seastar::stop_iteration::no;
return stop_t::no;
});
}

View File

@ -27,6 +27,8 @@ class AuthSessionHandler;
namespace ceph::net {
using stop_t = seastar::stop_iteration;
class SocketMessenger;
class SocketConnection;
using SocketConnectionRef = boost::intrusive_ptr<SocketConnection>;
@ -99,7 +101,7 @@ class SocketConnection : public Connection {
seastar::future<> maybe_throttle();
void read_tags_until_next_message();
seastar::future<seastar::stop_iteration> handle_ack();
seastar::future<stop_t> handle_ack();
/// becomes available when handshake completes, and when all previous messages
/// have been sent to the output stream. send() chains new messages as