Another fix: using strlen to determine the length of the packet is... unwise.

Remember the length when we create it.  This should fix the voxel server's not
appearing.
This commit is contained in:
Andrzej Kapolka 2013-06-13 13:15:08 -07:00
parent 78072fbde0
commit b57a78c414

View file

@ -205,6 +205,7 @@ void AgentList::sendDomainServerCheckIn() {
// construct the DS check in packet if we need to
static unsigned char* checkInPacket = NULL;
static int checkInPacketSize;
if (!checkInPacket) {
int numBytesAgentsOfInterest = _agentTypesOfInterest ? strlen((char*) _agentTypesOfInterest) : 0;
@ -236,10 +237,10 @@ void AgentList::sendDomainServerCheckIn() {
packetPosition += numBytesAgentsOfInterest;
}
*packetPosition = '\0';
checkInPacketSize = packetPosition - checkInPacket;
}
_agentSocket.send(DOMAIN_IP, DOMAINSERVER_PORT, checkInPacket, strlen((char*) checkInPacket));
_agentSocket.send(DOMAIN_IP, DOMAINSERVER_PORT, checkInPacket, checkInPacketSize);
}
int AgentList::processDomainServerList(unsigned char *packetData, size_t dataBytes) {