From 68bd5080631f710bc080d9cf3ccb8d49f5783460 Mon Sep 17 00:00:00 2001 From: Wiebe Cazemier Date: Sun, 3 Jan 2021 11:51:00 +0100 Subject: [PATCH] Make sure MqttPacket copy constructor is not used --- mqttpacket.h | 3 +++ 1 file changed, 3 insertions(+), 0 deletions(-) diff --git a/mqttpacket.h b/mqttpacket.h index 90df81a..f2092d7 100644 --- a/mqttpacket.h +++ b/mqttpacket.h @@ -47,6 +47,9 @@ public: PacketType packetType = PacketType::Reserved; MqttPacket(CirBuf &buf, size_t packet_len, size_t fixed_header_length, Client_p &sender); // Constructor for parsing incoming packets. + MqttPacket(MqttPacket &&other) = default; + MqttPacket(const MqttPacket &other) = delete; + // Constructor for outgoing packets. These may not allocate room for the fixed header, because we don't (always) know the length in advance. MqttPacket(const ConnAck &connAck); MqttPacket(const SubAck &subAck); -- libgit2 0.21.4