FreeRTOS / FreeRTOS-Plus-TCP

FreeRTOS-Plus-TCP library repository. +TCP files only. Submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
MIT License
152 stars 163 forks source link

Wrong test in function prvTCPSendLoop() #1043

Closed htibosch closed 1 year ago

htibosch commented 1 year ago

Description

Thanks to a forum user zugo83 in a post in the FreeRTOS Forum, we saw that the function FreeRTOS_send() would last longer than necessary.

The proposed change is as follows:

     xBytesLeft -= xByteCount;
     xBytesSent += xByteCount;

-    if( ( xBytesLeft == 0 ) && ( pvBuffer == NULL ) )
+    if( ( xBytesLeft == 0 ) || ( pvBuffer == NULL ) )
     {
         /* pvBuffer can be NULL in case TCP zero-copy transmissions are used. */
         break;
     }

This must have been a type that happened when we merged the trees IPv4 with IPv6/multi.

Test Steps

Try send loads of data before and after this change.

Checklist:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

htibosch commented 1 year ago

PS. I found the guilty PR: #317, mea culpa.

amazonKamath commented 1 year ago

Would be good to run iperf before merge