generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 206
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Tested on: the "main" branch, aka V4.0.0 as of Aug 10 2023
From the scarce information about TCP zero copy transmit I was able to figure out that I need to get a pointer to the stream buffer, copy my data and call FreeRTOS_send() with a NULL pointer.
The issue is the code snippet below from FreeRTOS_send() :
BaseType_t xByteCount = -pdFREERTOS_ERRNO_EINVAL;
FreeRTOS_Socket_t * pxSocket = ( FreeRTOS_Socket_t * ) xSocket;
if( pvBuffer != NULL )
{
/* Check if this is a valid TCP socket, affirm that it is not closed or closing,
* affirm that there was not malloc-problem, test if uxDataLength is non-zero,
* and if the connection is not in a confirmed FIN state. */
xByteCount = ( BaseType_t ) prvTCPSendCheck( pxSocket, uxDataLength );
}
if( xByteCount > 0 )
{
/* prvTCPSendLoop() will try to send as many bytes as possible,
* returning number of bytes that have been queued for transmission.. */
xByteCount = prvTCPSendLoop( pxSocket, pvBuffer, uxDataLength, xFlags );
if( xByteCount == 0 )
{
.
.
.
}
}
return xByteCount;
This will never work with pvBuffer = NULL and I was always getting a return of -pdFREERTOS_ERRNO_EINVAL.
That leads to a question: Is the use of NULL pointer deprecated now? If it is still allowed, then the check above is not correct.
After commenting out the if( pvBuffer != NULL ) check I was able to send data in the "zero copy" way.
Target
- All
Host
- NA
To Reproduce
- call FreeRTOS_send() with a NULL buffer pointer
Expected behavior
FreeRTOS_send() should return the number of bytes sent.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working