Skip to content

Commit

Permalink
Re-apply previous commit with a typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nerzhul committed Sep 4, 2017
1 parent 31e0f0e commit c05228f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/network/connection.h
Expand Up @@ -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_)
{
Expand Down

0 comments on commit c05228f

Please sign in to comment.