示例#1
0
void Node::parseIgnoreRequestMessage(QSharedPointer<ReceivedMessage> message) {    
    while (message->getBytesLeftToRead()) {
        // parse out the UUID being ignored from the packet
        QUuid ignoredUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));

        addIgnoredNode(ignoredUUID);
    }
}
示例#2
0
void Node::parseIgnoreRequestMessage(QSharedPointer<ReceivedMessage> message) {
    bool addToIgnore;
    message->readPrimitive(&addToIgnore);
    while (message->getBytesLeftToRead()) {
        // parse out the UUID being ignored from the packet
        QUuid ignoredUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));

        if (addToIgnore) {
            addIgnoredNode(ignoredUUID);
        } else {
            removeIgnoredNode(ignoredUUID);
        }
    }
}
示例#3
0
Node::NodesIgnoredPair Node::parseIgnoreRequestMessage(QSharedPointer<ReceivedMessage> message) {
    bool addToIgnore;
    message->readPrimitive(&addToIgnore);

    std::vector<QUuid> nodesIgnored;

    while (message->getBytesLeftToRead()) {
        // parse out the UUID being ignored from the packet
        QUuid ignoredUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));

        if (addToIgnore) {
            addIgnoredNode(ignoredUUID);
        } else {
            removeIgnoredNode(ignoredUUID);
        }

        nodesIgnored.push_back(ignoredUUID);
    }

    return { nodesIgnored, addToIgnore };
}