Skip to content

Commit c05228f

Browse files
committedSep 4, 2017
Re-apply previous commit with a typo fix
1 parent 31e0f0e commit c05228f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

Diff for: ‎src/network/connection.h

+12
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,18 @@ struct ConnectionCommand
330330
bool raw = false;
331331

332332
ConnectionCommand() = default;
333+
ConnectionCommand &operator=(const ConnectionCommand &other)
334+
{
335+
type = other.type;
336+
address = other.address;
337+
peer_id = other.peer_id;
338+
channelnum = other.channelnum;
339+
// We must copy the buffer here to prevent race condition
340+
data = SharedBuffer<u8>(*other.data, other.data.getSize());
341+
reliable = other.reliable;
342+
raw = other.raw;
343+
return *this;
344+
}
333345

334346
void serve(Address address_)
335347
{

0 commit comments

Comments
 (0)
Please sign in to comment.