Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 8 additions & 50 deletions FreeRTOS_TCP_WIN.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,14 @@
{
/* Could call vListInitialiseItem here but all data has been
* nulled already. Set the owner to a segment descriptor. */

#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instances of list-items are properly initialised, like in BufferAllocation_1, in BufferAllocation_2, and in FreeRTOS_Sockets.c

This PR will add initialisation in FreeRTOS_TCP_WIN.c.

One more change is needed, in FreeRTOS_DNS.c, around line 390:

     pxCallback->uxRemaningTime = uxTimeout;
     vTaskSetTimeOutState( &pxCallback->uxTimeoutState );
+    vListInitialiseItem( &( pxCallback->xListItem ) );
     listSET_LIST_ITEM_OWNER( &( pxCallback->xListItem ), ( void * ) pxCallback );

@AniruddhaKanhere , can you take care of that?

Also I think that in FreeRTOS_TCP_WIN.c, we can call vListInitialiseItem() unconditionally:

-    #if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 1 )
-    {
         vListInitialiseItem( &( xTCPSegments[ xIndex ].xSegmentItem ) );
         vListInitialiseItem( &( xTCPSegments[ xIndex ].xQueueItem ) );
-    }
-    #endif

It will not slow-down the application because this is only called at start-up time. And I noticed that in other instances vListInitialiseItem() is called unconditionally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add that in a separate PR. Thanks @htibosch.

{
vListInitialiseItem( &( xTCPSegments[ xIndex ].xSegmentItem ) );
vListInitialiseItem( &( xTCPSegments[ xIndex ].xQueueItem ) );
}
#endif

listSET_LIST_ITEM_OWNER( &( xTCPSegments[ xIndex ].xSegmentItem ), ( void * ) &( xTCPSegments[ xIndex ] ) );
listSET_LIST_ITEM_OWNER( &( xTCPSegments[ xIndex ].xQueueItem ), ( void * ) &( xTCPSegments[ xIndex ] ) );

Expand All @@ -455,7 +463,6 @@

return xReturn;
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -495,7 +502,6 @@

return pxReturn;
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -574,8 +580,6 @@

return pxSegment;
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -618,8 +622,6 @@

return xReturn;
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -652,7 +654,6 @@

return pxSegment;
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -683,7 +684,6 @@

return pxReturn;
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -718,8 +718,6 @@
/* Return it to xSegmentList */
vListInsertFifo( &xSegmentList, &( pxSegment->xSegmentItem ) );
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -761,8 +759,6 @@
}
}
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -895,8 +891,6 @@
xTCPSegments = NULL;
}
}


#endif /* ipconfgiUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1266,8 +1260,6 @@

return lReturn;
}


#endif /* ipconfgiUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1316,7 +1308,6 @@

return lReturn;
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1365,8 +1356,6 @@

return lToWrite;
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1458,8 +1447,6 @@

return lDone;
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand All @@ -1476,7 +1463,6 @@
{
return listLIST_IS_EMPTY( ( &pxWindow->xTxSegments ) );
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1545,8 +1531,6 @@

return xHasSpace;
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1636,8 +1620,6 @@

return xReturn;
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1858,8 +1840,6 @@

return ulReturn;
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -1895,7 +1875,6 @@
pxWindow->lSRTT = winSRTT_CAP_mS;
}
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2046,7 +2025,6 @@

return ulBytesConfirmed;
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2121,7 +2099,6 @@

return ulCount;
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2155,7 +2132,6 @@

return ulReturn;
}

#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2195,8 +2171,6 @@

return ulAckCount;
}


#endif /* ipconfigUSE_TCP_WIN == 1 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2254,8 +2228,6 @@

return iReturn;
}


#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2325,8 +2297,6 @@

return lResult;
}


#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2378,8 +2348,6 @@

return ulLength;
}


#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2409,12 +2377,10 @@

return xReturn;
}

#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

#if ( ipconfigUSE_TCP_WIN == 0 )

static BaseType_t prvTCPWindowTxHasSpace( TCPWindow_t const * pxWindow,
uint32_t ulWindowSize );

Expand Down Expand Up @@ -2442,7 +2408,6 @@

return xReturn;
}

#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2500,8 +2465,6 @@

return xReturn;
}


#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

Expand Down Expand Up @@ -2555,8 +2518,6 @@

return ulDataLength;
}


#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

Expand All @@ -2577,7 +2538,6 @@
* 'ulHighestSequenceNumber' is the highest sequence number seen. */
return xSequenceGreaterThanOrEqual( pxWindow->rx.ulCurrentSequenceNumber, pxWindow->rx.ulHighestSequenceNumber );
}

#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

Expand All @@ -2596,8 +2556,6 @@
* nothing to release. */
( void ) pxWindow;
}


#endif /* ipconfigUSE_TCP_WIN == 0 */
/*-----------------------------------------------------------*/

Expand Down