mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Merge pull request #6040 from huffman/fix-null-node
Fix case where we deref a null pointer in OctreeInboundPacketProcessor
This commit is contained in:
commit
b84109a781
6 changed files with 15 additions and 7 deletions
|
@ -261,6 +261,12 @@ int OctreeInboundPacketProcessor::sendNackPackets() {
|
|||
}
|
||||
|
||||
const SharedNodePointer& destinationNode = DependencyManager::get<NodeList>()->nodeWithUUID(nodeUUID);
|
||||
// If the node no longer exists, wait until the ReceivedPacketProcessor has cleaned up the node
|
||||
// to remove it from our stats list.
|
||||
// FIXME Is it safe to clean it up here before ReceivedPacketProcess has?
|
||||
if (!destinationNode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// retrieve sequence number stats of node, prune its missing set
|
||||
SequenceNumberStats& sequenceNumberStats = nodeStats.getIncomingEditSequenceNumberStats();
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
using namespace udt;
|
||||
|
||||
static int packetMetaTypeId = qRegisterMetaType<Packet*>("Packet*");
|
||||
|
||||
int Packet::localHeaderSize(bool isPartOfMessage) {
|
||||
return sizeof(Packet::SequenceNumberAndBitField) +
|
||||
(isPartOfMessage ? sizeof(Packet::MessageNumberAndBitField) + sizeof(MessagePartNumber) : 0);
|
||||
|
|
|
@ -88,7 +88,9 @@ private:
|
|||
mutable PacketPosition _packetPosition { PacketPosition::ONLY };
|
||||
mutable MessagePartNumber _messagePartNumber { 0 };
|
||||
};
|
||||
|
||||
|
||||
} // namespace udt
|
||||
|
||||
Q_DECLARE_METATYPE(udt::Packet*);
|
||||
|
||||
#endif // hifi_Packet_h
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
using namespace udt;
|
||||
|
||||
static int packetListMetaTypeId = qRegisterMetaType<PacketList*>("PacketList*");
|
||||
|
||||
std::unique_ptr<PacketList> PacketList::create(PacketType packetType, QByteArray extendedHeader,
|
||||
bool isReliable, bool isOrdered) {
|
||||
auto packetList = std::unique_ptr<PacketList>(new PacketList(packetType, extendedHeader,
|
||||
|
|
|
@ -118,4 +118,6 @@ template<typename T> std::unique_ptr<T> PacketList::takeFront() {
|
|||
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(udt::PacketList*);
|
||||
|
||||
#endif // hifi_PacketList_h
|
||||
|
|
|
@ -24,16 +24,10 @@
|
|||
|
||||
using namespace udt;
|
||||
|
||||
Q_DECLARE_METATYPE(Packet*);
|
||||
Q_DECLARE_METATYPE(PacketList*);
|
||||
|
||||
Socket::Socket(QObject* parent) :
|
||||
QObject(parent),
|
||||
_synTimer(new QTimer(this))
|
||||
{
|
||||
qRegisterMetaType<Packet*>("Packet*");
|
||||
qRegisterMetaType<PacketList*>("PacketList*");
|
||||
|
||||
connect(&_udpSocket, &QUdpSocket::readyRead, this, &Socket::readPendingDatagrams);
|
||||
|
||||
// make sure our synchronization method is called every SYN interval
|
||||
|
|
Loading…
Reference in a new issue