Tweaks to fix setCONNTest on Windows 8

- Temporarily disabled the sending of a CONF message from the plugin in response to setCONN. The CONF message causes crashes on Windows 8 when setCONN is called multiple times.
 -  Removed code that attempted to free result slots in parseRequest before overwritting them with new allocations. The CTests suite currently calls parseRequest with a multidimensional array allocated on the stack, resulting in an attempt to free stack memory. A better solution may be to simply check whether the existing result slots are long enough.
 - As of this commit, all tests in the CTests suite are passing on Windows 8 for X-Plane 9, X-Plane 10 23bit and X-Plane 10 64bit.
This commit is contained in:
Jason Watkins
2015-03-24 16:10:39 -07:00
parent fbeb297717
commit 66b074d89b
4 changed files with 8 additions and 7 deletions

View File

@@ -571,10 +571,10 @@ short parseRequest(const char my_message[], float *resultArray[], short arraySiz
for (i=0; i<count; i++) for (i=0; i<count; i++)
{ {
arraySizes[i] = my_message[place]; arraySizes[i] = my_message[place];
if (resultArray[i] != NULL) //if (resultArray[i] != NULL)
{ //{
free(resultArray[i]); // free(resultArray[i]);
} //}
resultArray[i] = malloc(arraySizes[i]*sizeof(float)); resultArray[i] = malloc(arraySizes[i]*sizeof(float));
memcpy(resultArray[i],&my_message[place + 1],arraySizes[i]*sizeof(float)); memcpy(resultArray[i],&my_message[place + 1],arraySizes[i]*sizeof(float));

Binary file not shown.

Binary file not shown.

View File

@@ -457,9 +457,10 @@ int handleCONN(char buf[])
updateLog(logmsg,strlen(logmsg)); updateLog(logmsg,strlen(logmsg));
// SEND CONFIRMATION // SEND CONFIRMATION
memcpy(sendSocket.xpIP,connectionList[current_connection].IP, sizeof(connectionList[current_connection].IP)); // TODO: Ivestigate why sending confirmation causes crashes on Windows 8
sendSocket.xpPort = connectionList[current_connection].recPort; //memcpy(sendSocket.xpIP,connectionList[current_connection].IP, sizeof(connectionList[current_connection].IP));
sendUDP(sendSocket, the_message, 5); //sendSocket.xpPort = connectionList[current_connection].recPort;
//sendUDP(sendSocket, the_message, 5);
return 0; return 0;
} }