mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 09:33:36 +02:00
Merge pull request #840 from birarda/master
repair header byte calculations in assignment server
This commit is contained in:
commit
a5459f8ab5
1 changed files with 2 additions and 3 deletions
|
@ -32,9 +32,8 @@ int main(int argc, const char* argv[]) {
|
|||
|
||||
UDPSocket serverSocket(ASSIGNMENT_SERVER_PORT);
|
||||
|
||||
int numHeaderBytes = numBytesForPacketHeader((unsigned char*) &PACKET_TYPE_SEND_ASSIGNMENT);
|
||||
unsigned char assignmentPacket[MAX_PACKET_SIZE_BYTES];
|
||||
populateTypeAndVersion(assignmentPacket, PACKET_TYPE_SEND_ASSIGNMENT);
|
||||
int numSendHeaderBytes = populateTypeAndVersion(assignmentPacket, PACKET_TYPE_SEND_ASSIGNMENT);
|
||||
|
||||
while (true) {
|
||||
if (serverSocket.receive((sockaddr*) &senderSocket, &senderData, &receivedBytes)) {
|
||||
|
@ -53,7 +52,7 @@ int main(int argc, const char* argv[]) {
|
|||
qDebug() << "Sending assignment with URL" << scriptURL << "\n";
|
||||
|
||||
int scriptURLBytes = scriptURL.size();
|
||||
memcpy(assignmentPacket + numHeaderBytes, scriptURL.toLocal8Bit().constData(), scriptURLBytes);
|
||||
memcpy(assignmentPacket + numSendHeaderBytes, scriptURL.toLocal8Bit().constData(), scriptURLBytes);
|
||||
|
||||
// send the assignment
|
||||
serverSocket.send((sockaddr*) &senderSocket, assignmentPacket, numHeaderBytes + scriptURLBytes);
|
||||
|
|
Loading…
Reference in a new issue