mirror of
https://github.com/apache/nuttx.git
synced 2025-12-20 04:09:12 +08:00
TCP: check for an active connection before cleaning it up
If there is no active connection (e.g. it is waiting in accept), then the connection object, which doesn't yet exist, should not be cleaned up when the socket is closed.
This commit is contained in:
committed by
Gregory Nutt
parent
5e3023bef1
commit
49e5cc5a6f
@@ -507,9 +507,12 @@ static uint16_t psock_send_interrupt(FAR struct net_driver_s *dev,
|
||||
{
|
||||
nllvdbg("Lost connection: %04x\n", flags);
|
||||
|
||||
/* Report not connected */
|
||||
if (psock->s_conn != NULL)
|
||||
{
|
||||
/* Report not connected */
|
||||
|
||||
net_lostconnection(psock, flags);
|
||||
net_lostconnection(psock, flags);
|
||||
}
|
||||
|
||||
/* Free write buffers and terminate polling */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user