mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-14 13:26:46 +02:00
Merge branch 'protocol' of https://github.com/Atlante45/hifi into atp
This commit is contained in:
commit
ea5da73683
2 changed files with 3 additions and 25 deletions
|
@ -42,32 +42,11 @@ std::unique_ptr<ControlPacket> ControlPacket::fromReceivedPacket(std::unique_ptr
|
|||
}
|
||||
|
||||
std::unique_ptr<ControlPacket> ControlPacket::create(Type type, qint64 size) {
|
||||
|
||||
std::unique_ptr<ControlPacket> controlPacket;
|
||||
|
||||
if (size == -1) {
|
||||
return std::unique_ptr<ControlPacket>(new ControlPacket(type));
|
||||
} else {
|
||||
// Fail with invalid size
|
||||
Q_ASSERT(size >= 0);
|
||||
|
||||
return std::unique_ptr<ControlPacket>(new ControlPacket(type, size));
|
||||
}
|
||||
}
|
||||
|
||||
ControlPacket::ControlPacket(Type type) :
|
||||
BasePacket(-1),
|
||||
_type(type)
|
||||
{
|
||||
adjustPayloadStartAndCapacity(ControlPacket::localHeaderSize());
|
||||
|
||||
open(QIODevice::ReadWrite);
|
||||
|
||||
writeType();
|
||||
return std::unique_ptr<ControlPacket>(new ControlPacket(type, size));
|
||||
}
|
||||
|
||||
ControlPacket::ControlPacket(Type type, qint64 size) :
|
||||
BasePacket(ControlPacket::localHeaderSize() + size),
|
||||
BasePacket((size == -1) ? -1 : ControlPacket::localHeaderSize() + size),
|
||||
_type(type)
|
||||
{
|
||||
adjustPayloadStartAndCapacity(ControlPacket::localHeaderSize());
|
||||
|
|
|
@ -47,8 +47,7 @@ public:
|
|||
void setType(Type type);
|
||||
|
||||
private:
|
||||
ControlPacket(Type type);
|
||||
ControlPacket(Type type, qint64 size);
|
||||
ControlPacket(Type type, qint64 size = -1);
|
||||
ControlPacket(std::unique_ptr<char> data, qint64 size, const HifiSockAddr& senderSockAddr);
|
||||
ControlPacket(ControlPacket&& other);
|
||||
ControlPacket(const ControlPacket& other) = delete;
|
||||
|
|
Loading…
Reference in a new issue