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

View file

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

View file

@ -20,7 +20,6 @@
#include "NodeList.h"
const int MAX_PAYLOAD_BYTES = 1024;
const int MAX_ASSIGNMENT_POOL_BYTES = 64 + sizeof('\0');
const QString emptyPool = QString();
@ -76,7 +75,7 @@ public:
Assignment::Location getLocation() const { return _location; }
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; };
const QString& getPool() const { return _pool; }