Fix leak in socket close
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@394 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
b54499d254
commit
7d1031cc71
@ -233,4 +233,5 @@
|
||||
* Add strcat() and strncat()
|
||||
* Integrated uIP micro webserver
|
||||
* Corrected a serious bug in TCP queue management
|
||||
* Fix leak in socket close logic
|
||||
|
||||
|
@ -358,14 +358,24 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.</blockq
|
||||
53272 428 3568 57268 dfb4 nuttx
|
||||
</pre>
|
||||
<p><b>DM320 (ARM9)</b>
|
||||
This build for the ARM9 target includes a signficant subset of OS
|
||||
features, ethernet driver and full TCP/IP, UDP and (minimal) ICMP
|
||||
stacks (via uIP). (11/8/07)
|
||||
This build for the ARM9 target includes a significant subset of OS
|
||||
features, a filesystem, Ethernet driver, full TCP/IP, UDP and (minimal)
|
||||
ICMP stacks (via uIP) and a small network test application: (11/8/07,
|
||||
configuration netconfig, examples/nettest)
|
||||
</p>
|
||||
<pre>
|
||||
text data bss dec hex filename
|
||||
49472 296 3972 53740 d1ec nuttx
|
||||
</pre>
|
||||
<p>
|
||||
Another build for the ARM9 target includes a minimal OS feature
|
||||
set, Ethernet driver, full TCP/IP and (minimal) ICMP stacks, and
|
||||
a small webserver: (11/20/07, configuration uipconfig, examples/uip)
|
||||
</p>
|
||||
<pre>
|
||||
text data bss dec hex filename
|
||||
52040 72 4148 56260 dbc4 nuttx
|
||||
</pre>
|
||||
<p><b>87C52</b>
|
||||
A reduced functionality OS test for the 8052 target requires only
|
||||
about 18-19Kb:
|
||||
@ -694,6 +704,7 @@ Other memory:
|
||||
* Add strcat() and strncat()
|
||||
* Integrated uIP micro webserver
|
||||
* Corrected a serious bug in TCP queue management
|
||||
* Fix leak in socket close logic
|
||||
</pre></ul>
|
||||
|
||||
<table width ="100%">
|
||||
|
3
TODO
3
TODO
@ -31,8 +31,9 @@ o C++ Support
|
||||
o Network
|
||||
- Did not implement send() and sendto() timeouts. Option is setable via setsockopt,
|
||||
but is not implemented.
|
||||
- netutils/telnetd (and maybe others) are seriously broken.
|
||||
- uIP's netutils/telnetd (and maybe others) are seriously broken.
|
||||
Need to be re-written to use listen() and accept()
|
||||
- uIP's netutils/webserver does not work reliably
|
||||
- Should implement SOCK_RAW
|
||||
- accept() and recvfrom() need to return connection address
|
||||
- Performance Improvements (uIP is not very fast):
|
||||
|
@ -79,12 +79,16 @@ int net_close(int sockfd)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
/* Perform the close depending on the protocol type */
|
||||
/* Perform uIP side of the close depending on the protocol type */
|
||||
|
||||
switch (psock->s_type)
|
||||
{
|
||||
case SOCK_STREAM:
|
||||
uip_tcpfree(psock->s_conn);
|
||||
{
|
||||
struct uip_conn *conn = psock->s_conn;
|
||||
uip_unlisten(conn);
|
||||
uip_tcpfree(conn);
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef CONFIG_NET_UDP
|
||||
@ -97,11 +101,9 @@ int net_close(int sockfd)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
/* Save the protocol type */
|
||||
|
||||
psock->s_type = 0;
|
||||
psock->s_conn = NULL;
|
||||
/* Then release the socket structure containing the connection */
|
||||
|
||||
sockfd_release(sockfd);
|
||||
return OK;
|
||||
|
||||
errout:
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <assert.h>
|
||||
#include <sched.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <net/uip/uip.h>
|
||||
#include <nuttx/net.h>
|
||||
|
Loading…
Reference in New Issue
Block a user