]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: Overload conn::send() method to take unique_ptr
authorAmnon Hanuhov <ahanukov@redhat.com>
Thu, 8 Apr 2021 14:10:25 +0000 (17:10 +0300)
committerAmnon Hanuhov <ahanukov@redhat.com>
Thu, 6 May 2021 17:22:05 +0000 (20:22 +0300)
Signed-off-by: Amnon Hanuhov <ahanukov@redhat.com>
src/crimson/net/Connection.h
src/crimson/net/SocketConnection.cc
src/crimson/net/SocketConnection.h

index 6af12692e78bce9dd44a2cb884552437d958d702..4e10dded230e54f768ef1732d38bdb7b7d2ea692 100644 (file)
@@ -126,6 +126,8 @@ class Connection : public seastar::enable_shared_from_this<Connection> {
 #endif
 
   /// send a message over a connection that has completed its handshake
+  virtual seastar::future<> send(MessageURef msg) = 0;
+  // The version with MessageRef will be dropped in the future
   virtual seastar::future<> send(MessageRef msg) = 0;
 
   /// send a keepalive message over a connection that has completed its
index 0c73440925268405881e283063e1bb1f9093b805..97fc76b730459a45ff3f31cbd0004e7846fee26a 100644 (file)
@@ -69,6 +69,12 @@ bool SocketConnection::peer_wins() const
   return (messenger.get_myaddr() > peer_addr || policy.server);
 }
 
+seastar::future<> SocketConnection::send(MessageURef msg)
+{
+  assert(seastar::this_shard_id() == shard_id());
+  return protocol->send(MessageRef{msg.release()});
+}
+
 seastar::future<> SocketConnection::send(MessageRef msg)
 {
   assert(seastar::this_shard_id() == shard_id());
index bb38750424faa6094042cfb55ce9c9408e2cf9fc..28a2491895e421ad1b78a2d469759ca24272e50d 100644 (file)
@@ -70,6 +70,7 @@ class SocketConnection : public Connection {
   bool peer_wins() const;
 #endif
 
+  seastar::future<> send(MessageURef msg) override;
   seastar::future<> send(MessageRef msg) override;
 
   seastar::future<> keepalive() override;