Merge branch 'atp' of https://github.com/birarda/hifi into protocol

This commit is contained in:
Atlante45 2015-07-15 19:04:06 -07:00
commit d8f4b08ecc
4 changed files with 6 additions and 5 deletions

View file

@ -41,7 +41,7 @@ std::unique_ptr<NLPacket> NLPacket::create(PacketType::Value type, qint64 size)
packet = std::unique_ptr<NLPacket>(new NLPacket(type, size));
}
packet->open(QIODevice::WriteOnly);
packet->open(QIODevice::ReadWrite);
return packet;
}

View file

@ -39,7 +39,6 @@ bool ReceivedPacketProcessor::process() {
quint64 now = usecTimestampNow();
quint64 sinceLastWindow = now - _lastWindowAt;
if (sinceLastWindow > USECS_PER_SECOND) {
lock();
float secondsSinceLastWindow = sinceLastWindow / USECS_PER_SECOND;

View file

@ -24,7 +24,7 @@ qint64 Packet::maxPayloadSize(PacketType::Value type) {
std::unique_ptr<Packet> Packet::create(PacketType::Value type, qint64 size) {
auto packet = std::unique_ptr<Packet>(new Packet(type, size));
packet->open(QIODevice::WriteOnly);
packet->open(QIODevice::ReadWrite);
return packet;
}
@ -106,7 +106,7 @@ Packet& Packet::operator=(const Packet& other) {
_type = other._type;
_packetSize = other._packetSize;
_packet = std::unique_ptr<char>(new char(_packetSize));
_packet = std::unique_ptr<char>(new char[_packetSize]);
memcpy(_packet.get(), other._packet.get(), _packetSize);
_payloadStart = _packet.get() + (other._payloadStart - other._packet.get());

View file

@ -20,6 +20,8 @@ JurisdictionListener::JurisdictionListener(NodeType_t type) :
_nodeType(type),
_packetSender(JurisdictionListener::DEFAULT_PACKETS_PER_SECOND)
{
setObjectName("Jurisdiction Listener");
connect(DependencyManager::get<NodeList>().data(), &NodeList::nodeKilled, this, &JurisdictionListener::nodeKilled);
// tell our NodeList we want to hear about nodes with our node type
@ -34,7 +36,7 @@ void JurisdictionListener::nodeKilled(SharedNodePointer node) {
bool JurisdictionListener::queueJurisdictionRequest() {
auto packet = NLPacket::create(PacketType::JurisdictionRequest, 0);
auto nodeList = DependencyManager::get<NodeList>();
int nodeCount = 0;