diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-19 23:35:42 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-11-19 23:35:42 +0000 |
commit | 273f068eebbf144445c615c0e4b7a3ce5b608cf5 (patch) | |
tree | 3ef1b109acfb85796b760a0ff0a4102644de1b0c /nuttx/net | |
parent | 0cc9b5ef69aa200c2610f3e87281fe9aa9d7d389 (diff) | |
download | px4-nuttx-273f068eebbf144445c615c0e4b7a3ce5b608cf5.tar.gz px4-nuttx-273f068eebbf144445c615c0e4b7a3ce5b608cf5.tar.bz2 px4-nuttx-273f068eebbf144445c615c0e4b7a3ce5b608cf5.zip |
Need to free any readahead buffers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@388 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/net')
-rw-r--r-- | nuttx/net/uip/uip-tcpconn.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/net/uip/uip-tcpconn.c b/nuttx/net/uip/uip-tcpconn.c index edeb464ec..952db8774 100644 --- a/nuttx/net/uip/uip-tcpconn.c +++ b/nuttx/net/uip/uip-tcpconn.c @@ -284,6 +284,9 @@ struct uip_conn *uip_tcpalloc(void) void uip_tcpfree(struct uip_conn *conn) { +#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0 + struct uip_readahead_s *readahead; +#endif irqstate_t flags; /* Because g_free_tcp_connections is accessed from user level and interrupt @@ -304,6 +307,15 @@ void uip_tcpfree(struct uip_conn *conn) dq_rem(&conn->node, &g_free_tcp_connections); } + /* Release any read-ahead buffers attached to the connection */ + +#if CONFIG_NET_NTCP_READAHEAD_BUFFERS > 0 + while ((readahead = (struct uip_readahead_s *)sq_remfirst(&conn->readahead)) != NULL) + { + uip_tcpreadaheadrelease(readahead); + } +#endif + /* Mark the connection available and put it into the free list */ conn->tcpstateflags = UIP_CLOSED; |