diff --git a/libraries/networking/src/NLPacket.cpp b/libraries/networking/src/NLPacket.cpp index 711114cc1e..1b1ac50eda 100644 --- a/libraries/networking/src/NLPacket.cpp +++ b/libraries/networking/src/NLPacket.cpp @@ -11,13 +11,13 @@ #include "NLPacket.h" -int64_t NLPacket::localHeaderSize(PacketType::Value type) { - int64_t size = ((NON_SOURCED_PACKETS.contains(type)) ? 0 : NUM_BYTES_RFC4122_UUID) + +qint64 NLPacket::localHeaderSize(PacketType::Value type) { + qint64 size = ((NON_SOURCED_PACKETS.contains(type)) ? 0 : NUM_BYTES_RFC4122_UUID) + ((NON_VERIFIED_PACKETS.contains(type)) ? 0 : NUM_BYTES_RFC4122_UUID); return size; } -int64_t NLPacket::maxPayloadSize(PacketType::Value type) { +qint64 NLPacket::maxPayloadSize(PacketType::Value type) { return Packet::maxPayloadSize(type) - localHeaderSize(type); } @@ -47,7 +47,7 @@ std::unique_ptr NLPacket::createCopy(const NLPacket& other) { return std::unique_ptr(new NLPacket(other)); } -NLPacket::NLPacket(PacketType::Value type, int64_t size) : Packet(type, localHeaderSize(type) + size) { +NLPacket::NLPacket(PacketType::Value type, qint64 size) : Packet(type, localHeaderSize(type) + size) { } NLPacket::NLPacket(const NLPacket& other) : Packet(other) { diff --git a/libraries/networking/src/NLPacket.h b/libraries/networking/src/NLPacket.h index 9368b25720..e70df1dad7 100644 --- a/libraries/networking/src/NLPacket.h +++ b/libraries/networking/src/NLPacket.h @@ -17,18 +17,18 @@ class NLPacket : public Packet { Q_OBJECT public: - static std::unique_ptr create(PacketType::Value type, int64_t size = -1); + static std::unique_ptr create(PacketType::Value type, qint64 size = -1); // Provided for convenience, try to limit use static std::unique_ptr createCopy(const NLPacket& other); - static int64_t localHeaderSize(PacketType::Value type); - static int64_t maxPayloadSize(PacketType::Value type); + static qint64 localHeaderSize(PacketType::Value type); + static qint64 maxPayloadSize(PacketType::Value type); virtual qint64 totalHeadersSize() const; // Cumulated size of all the headers virtual qint64 localHeaderSize() const; // Current level's header size protected: - NLPacket(PacketType::Value type, int64_t size); + NLPacket(PacketType::Value type, qint64 size); NLPacket(const NLPacket& other); void setSourceUuid(QUuid sourceUuid); diff --git a/libraries/networking/src/Packet.h b/libraries/networking/src/Packet.h index 1de17602da..e9483ca1f1 100644 --- a/libraries/networking/src/Packet.h +++ b/libraries/networking/src/Packet.h @@ -23,7 +23,7 @@ class Packet : public QIODevice { public: using SequenceNumber = uint16_t; - static std::unique_ptr create(PacketType::Value type, int64_t size = -1); + static std::unique_ptr create(PacketType::Value type, qint64 size = -1); // Provided for convenience, try to limit use static std::unique_ptr createCopy(const Packet& other);