mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-16 17:26:16 +02:00
have killNodeWithUUID return success to avoid double lookup
This commit is contained in:
parent
ea38c4cc49
commit
584e35e4ab
3 changed files with 6 additions and 5 deletions
|
@ -1836,9 +1836,7 @@ void DomainServer::processNodeDisconnectRequestPacket(QSharedPointer<NLPacket> p
|
||||||
|
|
||||||
qDebug() << "Received a disconnect request from node with UUID" << nodeUUID;
|
qDebug() << "Received a disconnect request from node with UUID" << nodeUUID;
|
||||||
|
|
||||||
if (limitedNodeList->nodeWithUUID(nodeUUID)) {
|
if (limitedNodeList->killNodeWithUUID(nodeUUID)) {
|
||||||
limitedNodeList->killNodeWithUUID(nodeUUID);
|
|
||||||
|
|
||||||
static auto removedNodePacket = NLPacket::create(PacketType::DomainServerRemovedNode, NUM_BYTES_RFC4122_UUID);
|
static auto removedNodePacket = NLPacket::create(PacketType::DomainServerRemovedNode, NUM_BYTES_RFC4122_UUID);
|
||||||
|
|
||||||
removedNodePacket->reset();
|
removedNodePacket->reset();
|
||||||
|
|
|
@ -441,7 +441,7 @@ void LimitedNodeList::reset() {
|
||||||
_nodeSocket.clearConnections();
|
_nodeSocket.clearConnections();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LimitedNodeList::killNodeWithUUID(const QUuid& nodeUUID) {
|
bool LimitedNodeList::killNodeWithUUID(const QUuid& nodeUUID) {
|
||||||
QReadLocker readLocker(&_nodeMutex);
|
QReadLocker readLocker(&_nodeMutex);
|
||||||
|
|
||||||
NodeHash::iterator it = _nodeHash.find(nodeUUID);
|
NodeHash::iterator it = _nodeHash.find(nodeUUID);
|
||||||
|
@ -456,7 +456,10 @@ void LimitedNodeList::killNodeWithUUID(const QUuid& nodeUUID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleNodeKill(matchingNode);
|
handleNodeKill(matchingNode);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LimitedNodeList::processKillNode(NLPacket& packet) {
|
void LimitedNodeList::processKillNode(NLPacket& packet) {
|
||||||
|
|
|
@ -230,7 +230,7 @@ public slots:
|
||||||
virtual void sendSTUNRequest();
|
virtual void sendSTUNRequest();
|
||||||
void sendPingPackets();
|
void sendPingPackets();
|
||||||
|
|
||||||
void killNodeWithUUID(const QUuid& nodeUUID);
|
bool killNodeWithUUID(const QUuid& nodeUUID);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void dataSent(quint8 channelType, int bytes);
|
void dataSent(quint8 channelType, int bytes);
|
||||||
|
|
Loading…
Reference in a new issue