mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
net/tcp: remove conn check since which can not be NULL
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -159,7 +159,7 @@ static uint16_t psock_connect_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
FAR void *pvpriv, uint16_t flags)
|
FAR void *pvpriv, uint16_t flags)
|
||||||
{
|
{
|
||||||
struct tcp_connect_s *pstate = pvpriv;
|
struct tcp_connect_s *pstate = pvpriv;
|
||||||
FAR struct tcp_conn_s *conn = pstate->tc_conn;
|
FAR struct tcp_conn_s *conn;
|
||||||
|
|
||||||
ninfo("flags: %04x\n", flags);
|
ninfo("flags: %04x\n", flags);
|
||||||
|
|
||||||
@@ -167,6 +167,8 @@ static uint16_t psock_connect_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
|
|
||||||
if (pstate)
|
if (pstate)
|
||||||
{
|
{
|
||||||
|
conn = pstate->tc_conn;
|
||||||
|
|
||||||
/* The following errors should be detected here (someday)
|
/* The following errors should be detected here (someday)
|
||||||
*
|
*
|
||||||
* ECONNREFUSED
|
* ECONNREFUSED
|
||||||
|
|||||||
@@ -273,8 +273,6 @@ static inline void psock_lost_connection(FAR struct tcp_conn_s *conn,
|
|||||||
conn->sndcb->event = NULL;
|
conn->sndcb->event = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn != NULL)
|
|
||||||
{
|
|
||||||
/* Free all queued write buffers */
|
/* Free all queued write buffers */
|
||||||
|
|
||||||
for (entry = sq_peek(&conn->unacked_q); entry; entry = next)
|
for (entry = sq_peek(&conn->unacked_q); entry; entry = next)
|
||||||
@@ -315,7 +313,6 @@ static inline void psock_lost_connection(FAR struct tcp_conn_s *conn,
|
|||||||
conn->tcpstateflags = TCP_CLOSED;
|
conn->tcpstateflags = TCP_CLOSED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: parse_sack
|
* Name: parse_sack
|
||||||
|
|||||||
Reference in New Issue
Block a user