domain-server patches while looking for payload/pool errors

This commit is contained in:
Stephen Birarda 2014-01-29 14:23:39 -08:00
parent 15ba5f7ab1
commit 7d27830064
3 changed files with 6 additions and 13 deletions

View file

@ -575,7 +575,7 @@ void DomainServer::prepopulateStaticAssignmentFile() {
Assignment voxelServerAssignment(Assignment::CreateCommand, Assignment voxelServerAssignment(Assignment::CreateCommand,
Assignment::VoxelServerType, Assignment::VoxelServerType,
(assignmentPool.isEmpty() ? NULL : assignmentPool.toLocal8Bit().constData())); assignmentPool);
voxelServerAssignment.setPayload(config.toUtf8()); voxelServerAssignment.setPayload(config.toUtf8());
@ -615,8 +615,8 @@ void DomainServer::prepopulateStaticAssignmentFile() {
} }
Assignment particleServerAssignment(Assignment::CreateCommand, Assignment particleServerAssignment(Assignment::CreateCommand,
Assignment::ParticleServerType, Assignment::ParticleServerType,
(assignmentPool.isEmpty() ? NULL : assignmentPool.toLocal8Bit().constData())); assignmentPool);
particleServerAssignment.setPayload(config.toLocal8Bit()); particleServerAssignment.setPayload(config.toLocal8Bit());
@ -689,7 +689,7 @@ Assignment* DomainServer::deployableAssignmentForRequest(Assignment& requestAssi
bool assignmentTypesMatch = (*assignment)->getType() == requestAssignment.getType(); bool assignmentTypesMatch = (*assignment)->getType() == requestAssignment.getType();
bool nietherHasPool = (*assignment)->getPool().isEmpty() && requestAssignment.getPool().isEmpty(); bool nietherHasPool = (*assignment)->getPool().isEmpty() && requestAssignment.getPool().isEmpty();
bool assignmentPoolsMatch = (*assignment)->getPool() == requestAssignment.getPool(); bool assignmentPoolsMatch = (*assignment)->getPool() == requestAssignment.getPool();
if ((requestIsAllTypes || assignmentTypesMatch) && (nietherHasPool || assignmentPoolsMatch)) { if ((requestIsAllTypes || assignmentTypesMatch) && (nietherHasPool || assignmentPoolsMatch)) {
Assignment* deployableAssignment = *assignment; Assignment* deployableAssignment = *assignment;

View file

@ -14,9 +14,6 @@
#include "Assignment.h" #include "Assignment.h"
const char IPv4_ADDRESS_DESIGNATOR = 4;
const char IPv6_ADDRESS_DESIGNATOR = 6;
Assignment::Type Assignment::typeForNodeType(NodeType_t nodeType) { Assignment::Type Assignment::typeForNodeType(NodeType_t nodeType) {
switch (nodeType) { switch (nodeType) {
case NodeType::AudioMixer: case NodeType::AudioMixer:
@ -95,10 +92,7 @@ Assignment::Assignment(const QByteArray& packet) :
} }
packetStream >> _pool; packetStream >> _pool;
packetStream >> _payload;
if (!packetStream.atEnd()) {
_payload = packet.mid(packetStream.device()->pos());
}
} }
#ifdef WIN32 #ifdef WIN32

View file

@ -20,7 +20,6 @@
#include "NodeList.h" #include "NodeList.h"
const int MAX_PAYLOAD_BYTES = 1024; const int MAX_PAYLOAD_BYTES = 1024;
const int MAX_ASSIGNMENT_POOL_BYTES = 64 + sizeof('\0');
const QString emptyPool = QString(); const QString emptyPool = QString();
@ -76,7 +75,7 @@ public:
Assignment::Location getLocation() const { return _location; } Assignment::Location getLocation() const { return _location; }
const QByteArray& getPayload() const { return _payload; } const QByteArray& getPayload() const { return _payload; }
void setPayload(const QByteArray& payload) { _payload = payload; } void setPayload(const QByteArray& payload) { _payload = payload.left(MAX_PAYLOAD_BYTES); }
void setPool(const QString& pool) { _pool = pool; }; void setPool(const QString& pool) { _pool = pool; };
const QString& getPool() const { return _pool; } const QString& getPool() const { return _pool; }