fix recursive mutex lock, conditional, logging

This commit is contained in:
Stephen Birarda 2016-07-11 14:05:48 -07:00
parent bb68e777e6
commit 441b6d2813
3 changed files with 7 additions and 5 deletions

View file

@ -425,7 +425,6 @@ qint64 LimitedNodeList::sendPacket(std::unique_ptr<NLPacket> packet, const Node&
}
int LimitedNodeList::updateNodeWithDataFromPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) {
QMutexLocker locker(&sendingNode->getMutex());
NodeData* linkedData = getOrCreateLinkedData(sendingNode);

View file

@ -82,7 +82,8 @@ void Node::handleNodeIgnoreRequest(QSharedPointer<ReceivedMessage> packet) {
// parse out the UUID being ignored from the packet
QUuid ignoredUUID = QUuid::fromRfc4122(packet->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
qDebug() << "Adding" << ignoredUUID << "to ignore set for" << _uuid;
qDebug() << "Adding" << uuidStringWithoutCurlyBraces(ignoredUUID) << "to ignore set for"
<< uuidStringWithoutCurlyBraces(_uuid);
// add the session UUID to the set of ignored ones for this listening node
_ignoredNodeIDSet.insert(ignoredUUID);

View file

@ -21,10 +21,10 @@ void UsersScriptingInterface::ignore(const QUuid& nodeID) {
auto nodeList = DependencyManager::get<NodeList>();
nodeList->eachMatchingNode([&nodeID](const SharedNodePointer& node)->bool {
if (node->getType() != NodeType::AudioMixer || node->getType() != NodeType::AvatarMixer) {
return false;
} else {
if (node->getType() == NodeType::AudioMixer || node->getType() == NodeType::AvatarMixer) {
return true;
} else {
return false;
}
}, [&nodeID, &nodeList](const SharedNodePointer& destinationNode) {
// create a reliable NLPacket with space for the ignore UUID
@ -33,6 +33,8 @@ void UsersScriptingInterface::ignore(const QUuid& nodeID) {
// write the node ID to the packet
ignorePacket->write(nodeID.toRfc4122());
qDebug() << "Sending packet to ignore node" << uuidStringWithoutCurlyBraces(nodeID);
// send off this ignore packet reliably to the matching node
nodeList->sendPacket(std::move(ignorePacket), *destinationNode);
});