From fd48a582ed6c0dbe02dc753aad29febf2b3ca85f Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 20 Nov 2007 21:55:06 +0000 Subject: [PATCH] Fix TCP list managment bug git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@392 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/ChangeLog | 1 + nuttx/Documentation/NuttX.html | 3 ++- nuttx/net/uip/uip-tcpconn.c | 2 +- nuttx/netutils/webserver/httpd.c | 4 ++-- nuttx/netutils/webserver/httpd.h | 15 ++++++++++++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index e0316a37a..6543fbad9 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -232,4 +232,5 @@ * Add strcat() and strncat() * Integrated uIP micro webserver + * Corrected a serious bug in TCP queue management diff --git a/nuttx/Documentation/NuttX.html b/nuttx/Documentation/NuttX.html index d277aaa2b..2bee653cd 100644 --- a/nuttx/Documentation/NuttX.html +++ b/nuttx/Documentation/NuttX.html @@ -8,7 +8,7 @@

NuttX RTOS

-

Last Updated: November 19, 2007

+

Last Updated: November 20, 2007

@@ -693,6 +693,7 @@ Other memory: * Add strcat() and strncat() * Integrated uIP micro webserver + * Corrected a serious bug in TCP queue management diff --git a/nuttx/net/uip/uip-tcpconn.c b/nuttx/net/uip/uip-tcpconn.c index 952db8774..96849d926 100644 --- a/nuttx/net/uip/uip-tcpconn.c +++ b/nuttx/net/uip/uip-tcpconn.c @@ -304,7 +304,7 @@ void uip_tcpfree(struct uip_conn *conn) { /* Remove the connection from the active list */ - dq_rem(&conn->node, &g_free_tcp_connections); + dq_rem(&conn->node, &g_active_tcp_connections); } /* Release any read-ahead buffers attached to the connection */ diff --git a/nuttx/netutils/webserver/httpd.c b/nuttx/netutils/webserver/httpd.c index 4564a7652..1f360c1ab 100644 --- a/nuttx/netutils/webserver/httpd.c +++ b/nuttx/netutils/webserver/httpd.c @@ -469,7 +469,7 @@ static void *httpd_handler(void *arg) if (pstate) { /* Loop processing each HTTP command */ - do +// do { /* Re-initialize the thread state structure */ @@ -480,7 +480,7 @@ static void *httpd_handler(void *arg) ret = httpd_cmd(pstate); } - while (ret == OK); +// while (ret == OK); /* End of command processing -- Clean up and exit */ diff --git a/nuttx/netutils/webserver/httpd.h b/nuttx/netutils/webserver/httpd.h index 031d90187..7e70ccd41 100644 --- a/nuttx/netutils/webserver/httpd.h +++ b/nuttx/netutils/webserver/httpd.h @@ -54,9 +54,22 @@ ****************************************************************************/ #define HTTPD_FS_STATISTICS 1 -#define HTTPD_IOBUFFER_SIZE UIP_TCP_MSS + +/* For efficiency reasons, the size of the IO buffer should be a multiple + * of the TCP MSS value. Also, the current design requires that the IO + * buffer be sufficiently large to contain the entire GET request. + */ + +#define HTTPD_IOBUFFER_SIZE (3*UIP_TCP_MSS) + +/* this is the maximum size of a file path */ + #define HTTPD_MAX_FILENAME 20 +/* As threads are created to handle each request, a stack must be allocated + * for the thread. Use a default if the user provided no stacksize. + */ + #ifndef CONFIG_EXAMPLES_UIP_HTTPDSTACKSIZE # define CONFIG_EXAMPLES_UIP_HTTPDSTACKSIZE 4096 #endif