class Protocol {
protected:
+ int proto_type;
AsyncConnection *connection;
AsyncMessenger *messenger;
CephContext *cct;
public:
- Protocol(AsyncConnection *connection);
+ Protocol(int type, AsyncConnection *connection);
virtual ~Protocol();
// prepare protocol for connecting to peer
virtual bool is_queued() = 0;
};
-#endif /* _MSG_ASYNC_PROTOCOL_ */
\ No newline at end of file
+#endif /* _MSG_ASYNC_PROTOCOL_ */
data.push_back(std::move(ptr));
}
-Protocol::Protocol(AsyncConnection *connection)
- : connection(connection),
- messenger(connection->async_msgr),
- cct(connection->async_msgr->cct) {}
+Protocol::Protocol(int type, AsyncConnection *connection)
+ : proto_type(type),
+ connection(connection),
+ messenger(connection->async_msgr),
+ cct(connection->async_msgr->cct) {}
Protocol::~Protocol() {}
**/
ProtocolV1::ProtocolV1(AsyncConnection *connection)
- : Protocol(connection),
+ : Protocol(1, connection),
temp_buffer(nullptr),
can_write(WriteStatus::NOWRITE),
keepalive(false),
// AsyncConnection here)
ProtocolV1 *exproto = dynamic_cast<ProtocolV1 *>(existing->protocol.get());
+ assert(exproto->proto_type == 1);
if (!exproto) {
ldout(cct, 1) << __func__ << " existing=" << existing << dendl;
**/
ProtocolV2::ProtocolV2(AsyncConnection *connection)
- : Protocol(connection),
+ : Protocol(2, connection),
temp_buffer(nullptr),
peer_addr_count(0),
can_write(WriteStatus::NOWRITE),
// AsyncConnection here)
ProtocolV2 *exproto = dynamic_cast<ProtocolV2 *>(existing->protocol.get());
+ assert(exproto->proto_type == 2);
if (!exproto) {
ldout(cct, 1) << __func__ << " existing=" << existing << dendl;