1
0
Fork 0
forked from nuttx/nuttx-update

tcp_close: replace scaring comments

This commit is contained in:
YAMAMOTO Takashi 2021-06-29 19:18:00 +09:00 committed by Xiang Xiao
parent 84100128b2
commit 8472430f22
2 changed files with 3 additions and 15 deletions

View file

@ -266,19 +266,7 @@ static inline int tcp_close_disconnect(FAR struct socket *psock)
/* If we have a semi-permanent write buffer callback in place, then
* is needs to be be nullified.
*
* Commit f1ef2c6cdeb032eaa1833cc534a63b50c5058270:
* "When a socket is closed, it should make sure that any pending write
* data is sent before the FIN is sent. It already would wait for all
* sent data to be acked, however it would discard any pending write
* data that had not been sent at least once.
*
* "This change adds a check for pending write data in addition to unacked
* data. However, to be able to actually send any new data, the send
* callback must be left. The callback should be freed later when the
* socket is actually destroyed."
*
* REVISIT: Where and how exactly is s_sndcb ever freed? Is there a
* memory leak here?
* Note: the callback will be freed by tcp_free.
*/
psock->s_sndcb = NULL;

View file

@ -703,8 +703,8 @@ void tcp_free(FAR struct tcp_conn_s *conn)
DEBUGASSERT(conn->crefs == 0);
net_lock();
/* Free remaining callbacks, actually there should be only the close
* callback left.
/* Free remaining callbacks, actually there should be only the send
* callback for CONFIG_NET_TCP_WRITE_BUFFERS is left.
*/
for (cb = conn->list; cb; cb = next)