#include "messages/MCommandReply.h"
#include "crimson/common/log.h"
#include "crimson/net/Socket.h"
+#include "crimson/net/Connection.h"
using namespace crimson::common;
using namespace std::literals;
#include "crimson/osd/pg_map.h"
#include "crimson/osd/state.h"
#include "common/AsyncReserver.h"
+#include "crimson/net/Connection.h"
namespace crimson::net {
class Messenger;
tid(t), client_caps(caps), msg(NULL) {
client_type = m->get_source().type();
client_addrs = m->get_source_addrs();
+#ifdef WITH_SEASTAR
+ ceph_abort("In crimson, conn is independently maintained outside Message");
+#else
if (auto &con = m->get_connection()) {
client_socket_addr = con->get_peer_socket_addr();
}
+#endif
con_features = feat;
msg = (PaxosServiceMessage*)m->get();
}
if (features)
return features;
#ifdef WITH_SEASTAR
- // In crimson, conn is independently maintained outside Message.
- ceph_abort();
-#endif
+ ceph_abort("In crimson, conn is independently maintained outside Message");
+#else
return get_connection()->get_features();
+#endif
}
MOSDOp()
if (front_crc != footer.front_crc) {
if (cct) {
ldout(cct, 0) << "bad crc in front " << front_crc << " != exp " << footer.front_crc
- << " from " << conn->get_peer_addr() << dendl;
+#ifndef WITH_SEASTAR
+ << " from " << conn->get_peer_addr()
+#endif
+ << dendl;
ldout(cct, 20) << " ";
front.hexdump(*_dout);
*_dout << dendl;
if (middle_crc != footer.middle_crc) {
if (cct) {
ldout(cct, 0) << "bad crc in middle " << middle_crc << " != exp " << footer.middle_crc
- << " from " << conn->get_peer_addr() << dendl;
+#ifndef WITH_SEASTAR
+ << " from " << conn->get_peer_addr()
+#endif
+ << dendl;
ldout(cct, 20) << " ";
middle.hexdump(*_dout);
*_dout << dendl;
if (data_crc != footer.data_crc) {
if (cct) {
ldout(cct, 0) << "bad crc in data " << data_crc << " != exp " << footer.data_crc
- << " from " << conn->get_peer_addr() << dendl;
+#ifndef WITH_SEASTAR
+ << " from " << conn->get_peer_addr()
+#endif
+ << dendl;
ldout(cct, 20) << " ";
data.hexdump(*_dout);
*_dout << dendl;
#include "msg/MessageRef.h"
#include "msg_types.h"
-#ifdef WITH_SEASTAR
-# include "crimson/net/SocketConnection.h"
-#endif // WITH_SEASTAR
-
// monitor internal
#define MSG_MON_SCRUB 64
#define MSG_MON_ELECTION 65
class Message : public RefCountedObject {
public:
#ifdef WITH_SEASTAR
- using ConnectionRef = crimson::net::ConnectionRef;
+ // In crimson, conn is independently maintained outside Message.
+ using ConnectionRef = void*;
#else
using ConnectionRef = ::ConnectionRef;
-#endif // WITH_SEASTAR
+#endif
protected:
ceph_msg_header header; // headerelope
public:
const ConnectionRef& get_connection() const {
#ifdef WITH_SEASTAR
- // In crimson, conn is independently maintained outside Message.
- ceph_abort();
+ ceph_abort("In crimson, conn is independently maintained outside Message");
#endif
return connection;
}
return entity_name_t(header.src);
}
entity_addr_t get_source_addr() const {
+#ifdef WITH_SEASTAR
+ ceph_abort("In crimson, conn is independently maintained outside Message");
+#else
if (connection)
return connection->get_peer_addr();
+#endif
return entity_addr_t();
}
entity_addrvec_t get_source_addrs() const {
+#ifdef WITH_SEASTAR
+ ceph_abort("In crimson, conn is independently maintained outside Message");
+#else
if (connection)
return connection->get_peer_addrs();
+#endif
return entity_addrvec_t();
}
public:
using Message::Message;
bool is_a_client() const {
+#ifdef WITH_SEASTAR
+ ceph_abort("In crimson, conn is independently maintained outside Message");
+#else
return get_connection()->get_peer_type() == CEPH_ENTITY_TYPE_CLIENT;
+#endif
}
private:
void _dump(ceph::Formatter *f) const override;
bool has_feature(uint64_t f) const {
+#ifdef WITH_SEASTAR
+ ceph_abort("In crimson, conn is independently maintained outside Message");
+#else
return request->get_connection()->has_feature(f);
+#endif
}
private: