Re-apply previous commit with a typo fix
authorLoïc Blot <loic.blot@unix-experience.fr>
Mon, 4 Sep 2017 14:46:03 +0000 (16:46 +0200)
committerLoïc Blot <loic.blot@unix-experience.fr>
Mon, 4 Sep 2017 15:37:08 +0000 (17:37 +0200)
src/network/connection.h

index e1bb613f084d4c5c07cca5546f1fcc9911830db8..d569722bf68593231e5cb037a4b5ed6a20ac46d4 100644 (file)
@@ -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<u8>(*other.data, other.data.getSize());
+               reliable = other.reliable;
+               raw = other.raw;
+               return *this;
+       }
 
        void serve(Address address_)
        {