const static hobject_t hobj(object_t(), oloc.key, CEPH_NOSNAP, pgid.ps(),
pgid.pool(), oloc.nspace);
static spg_t spgid(pgid);
- MOSDOp *rep = new MOSDOp(0, 0, hobj, spgid, 0, 0, 0);
+ auto rep = make_message<MOSDOp>(0, 0, hobj, spgid, 0, 0, 0);
bufferlist data(msg_data);
rep->write(0, msg_len, data);
rep->set_tid(m->get_tid());
- MessageRef msg = {rep, false};
- return c->send(msg);
+ return c->send(std::move(rep));
}
seastar::future<> init(bool v1_crc_enabled, const entity_addr_t& addr) {
const static hobject_t hobj(object_t(), oloc.key, CEPH_NOSNAP, pgid.ps(),
pgid.pool(), oloc.nspace);
static spg_t spgid(pgid);
- MOSDOp *m = new MOSDOp(0, 0, hobj, spgid, 0, 0, 0);
+ auto m = make_message<MOSDOp>(0, 0, hobj, spgid, 0, 0, 0);
bufferlist data(msg_data);
m->write(0, msg_len, data);
- MessageRef msg = {m, false};
-
// use tid as the identity of each round
m->set_tid(sent_count);
time_msgs_sent[index] = mono_clock::now();
}
- return conn->send(msg);
+ return conn->send(std::move(m));
});
}
seastar::future<> ms_dispatch(ceph::net::Connection* c,
MessageRef m) override {
- return c->send(MessageRef{new MPing, false});
+ return c->send(make_message<MPing>());
}
public:
seastar::do_until(
[this] { return stop_send; },
[this, conn = &**conn] {
- return conn->send(MessageRef{new MPing, false}).then([] {
+ return conn->send(make_message<MPing>()).then([] {
return seastar::sleep(0ms);
});
}