mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
tcp_lost_connection() is called from two places in tcp_sendfile.c
This commit is contained in:
+15
-1
@@ -366,11 +366,25 @@ static uint16_t sendfile_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
if ((flags & TCP_DISCONN_EVENTS) != 0)
|
if ((flags & TCP_DISCONN_EVENTS) != 0)
|
||||||
{
|
{
|
||||||
|
FAR struct socket *psock = pstate->snd_sock;
|
||||||
|
|
||||||
nwarn("WARNING: Lost connection\n");
|
nwarn("WARNING: Lost connection\n");
|
||||||
|
|
||||||
|
/* We could get here recursively through the callback actions of
|
||||||
|
* tcp_lost_connection(). So don't repeat that action if we have
|
||||||
|
* already been disconnected.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DEBUGASSERT(psock != NULL);
|
||||||
|
if (_SS_ISCONNECTED(psock->s_flags))
|
||||||
|
{
|
||||||
|
/* Report not connected */
|
||||||
|
|
||||||
|
tcp_lost_connection(psock, pstate->snd_datacb, flags);
|
||||||
|
}
|
||||||
|
|
||||||
/* Report not connected */
|
/* Report not connected */
|
||||||
|
|
||||||
tcp_lost_connection(pstate->snd_sock, pstate->snd_datacb, flags);
|
|
||||||
pstate->snd_sent = -ENOTCONN;
|
pstate->snd_sent = -ENOTCONN;
|
||||||
goto end_wait;
|
goto end_wait;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user