Have Marinetti return read data in a new handle.

This should be faster than the other options (reusing an existing handle or using a pointer) because it avoids an extra copy of the data inside Marinetti. For the other options, Marinetti will create a new handle and copy the data to it anyway, but then copy it again into the requested destination.
This commit is contained in:
Stephen Heumann 2016-05-28 20:41:43 -05:00
parent 46a1657580
commit 3a175f9b02

View File

@ -360,11 +360,13 @@ BOOLEAN DoReadTCP (unsigned long dataLength) {
if (theSRBuff.srRcvQueued < dataLength)
return FALSE;
if ((tcperr = TCPIPReadTCP(hostIpid, buffTypeHandle, (Ref) readBufferHndl,
DisposeHandle(readBufferHndl);
if ((tcperr = TCPIPReadTCP(hostIpid, buffTypeNewHandle, NULL,
dataLength, &theRRBuff)) != tcperrOK)
return FALSE;
if (toolerror())
return FALSE;
readBufferHndl = theRRBuff.rrBuffHandle;
if (theRRBuff.rrBuffCount != dataLength)
return ReadFixup(dataLength, theRRBuff.rrBuffCount);