mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 19:36:45 +02:00
repair to NLPacket creation from Packet and char*
This commit is contained in:
parent
fb7130120a
commit
1386aa57da
2 changed files with 3 additions and 3 deletions
|
@ -619,7 +619,7 @@ void LimitedNodeList::sendSTUNRequest() {
|
||||||
|
|
||||||
flagTimeForConnectionStep(ConnectionStep::SendSTUNRequest);
|
flagTimeForConnectionStep(ConnectionStep::SendSTUNRequest);
|
||||||
|
|
||||||
_nodeSocket.writeDatagram(QByteArray::fromRawData(stunRequestPacket, sizeof(stunRequestPacket)), _stunSockAddr);
|
_nodeSocket.writeDatagram(stunRequestPacket, sizeof(stunRequestPacket), _stunSockAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LimitedNodeList::processSTUNResponse(QSharedPointer<NLPacket> packet) {
|
bool LimitedNodeList::processSTUNResponse(QSharedPointer<NLPacket> packet) {
|
||||||
|
|
|
@ -112,7 +112,7 @@ NLPacket& NLPacket::operator=(const NLPacket& other) {
|
||||||
NLPacket::NLPacket(std::unique_ptr<char> data, qint64 size, const HifiSockAddr& senderSockAddr) :
|
NLPacket::NLPacket(std::unique_ptr<char> data, qint64 size, const HifiSockAddr& senderSockAddr) :
|
||||||
Packet(std::move(data), size, senderSockAddr)
|
Packet(std::move(data), size, senderSockAddr)
|
||||||
{
|
{
|
||||||
adjustPayloadStartAndCapacity();
|
adjustPayloadStartAndCapacity(_payloadSize > 0);
|
||||||
|
|
||||||
readSourceID();
|
readSourceID();
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ QByteArray NLPacket::hashForPacketAndSecret(const udt::Packet& packet, const QUu
|
||||||
int offset = packet.Packet::localHeaderSize() + NUM_BYTES_RFC4122_UUID + NUM_BYTES_MD5_HASH;
|
int offset = packet.Packet::localHeaderSize() + NUM_BYTES_RFC4122_UUID + NUM_BYTES_MD5_HASH;
|
||||||
|
|
||||||
// add the packet payload and the connection UUID
|
// add the packet payload and the connection UUID
|
||||||
hash.addData(packet.getData(), packet.getDataSize() - offset);
|
hash.addData(packet.getData() + offset, packet.getDataSize() - offset);
|
||||||
hash.addData(connectionSecret.toRfc4122());
|
hash.addData(connectionSecret.toRfc4122());
|
||||||
|
|
||||||
// return the hash
|
// return the hash
|
||||||
|
|
Loading…
Reference in a new issue