File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -2356,17 +2356,25 @@ void * vSocketClose( FreeRTOS_Socket_t * pxSocket )
23562356 uint32_t ulNewValue ;
23572357 BaseType_t xReturn ;
23582358
2359+ if ( ( FreeRTOS_issocketconnected ( pxSocket ) == pdTRUE ) )
2360+ {
2361+ /* If this socket is the child of a listening socket, the remote client may or may not have already sent
2362+ * us data. If data was already sent, then pxSocket->u.xTCP.rxStream != NULL and this call will fail.
2363+ * Warn the user about this inconsistent behavior. */
2364+ FreeRTOS_printf ( ( "Warning: Changing buffer/window properties on a connected socket may fail." ) );
2365+ }
2366+
23592367 if ( pxSocket -> ucProtocol != ( uint8_t ) FREERTOS_IPPROTO_TCP )
23602368 {
2361- FreeRTOS_debug_printf ( ( "Set SO_%sBUF: wrong socket type\n" ,
2362- ( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) );
2369+ FreeRTOS_printf ( ( "Set SO_%sBUF: wrong socket type\n" ,
2370+ ( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) );
23632371 xReturn = - pdFREERTOS_ERRNO_EINVAL ;
23642372 }
23652373 else if ( ( ( lOptionName == FREERTOS_SO_SNDBUF ) && ( pxSocket -> u .xTCP .txStream != NULL ) ) ||
23662374 ( ( lOptionName == FREERTOS_SO_RCVBUF ) && ( pxSocket -> u .xTCP .rxStream != NULL ) ) )
23672375 {
2368- FreeRTOS_debug_printf ( ( "Set SO_%sBUF: buffer already created\n" ,
2369- ( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) );
2376+ FreeRTOS_printf ( ( "Set SO_%sBUF: buffer already created\n" ,
2377+ ( lOptionName == FREERTOS_SO_SNDBUF ) ? "SND" : "RCV" ) );
23702378 xReturn = - pdFREERTOS_ERRNO_EINVAL ;
23712379 }
23722380 else
You can’t perform that action at this time.
0 commit comments