From c05228fa6d446022cdf675865f9a420c95619313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Mon, 4 Sep 2017 16:46:03 +0200 Subject: [PATCH] Re-apply previous commit with a typo fix --- src/network/connection.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/network/connection.h b/src/network/connection.h index e1bb613f0..d569722bf 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -330,6 +330,18 @@ struct ConnectionCommand bool raw = false; ConnectionCommand() = default; + ConnectionCommand &operator=(const ConnectionCommand &other) + { + type = other.type; + address = other.address; + peer_id = other.peer_id; + channelnum = other.channelnum; + // We must copy the buffer here to prevent race condition + data = SharedBuffer(*other.data, other.data.getSize()); + reliable = other.reliable; + raw = other.raw; + return *this; + } void serve(Address address_) {