diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-02-03 13:08:37 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-02-03 13:08:37 +0000 |
commit | 7d3ed400704f76e4ea3bae759d1c2298b1098585 (patch) | |
tree | e4c2ba67dfa9441a2d30a704cfea504ffcf88c53 /Projects/Webserver | |
parent | b9cf4815e5445db2d805117c90adaa1755c853cf (diff) | |
download | lufa-7d3ed400704f76e4ea3bae759d1c2298b1098585.tar.gz lufa-7d3ed400704f76e4ea3bae759d1c2298b1098585.tar.bz2 lufa-7d3ed400704f76e4ea3bae759d1c2298b1098585.zip |
Fix TELNET server locking up if an invalid command was issued.
Diffstat (limited to 'Projects/Webserver')
-rw-r--r-- | Projects/Webserver/Lib/HTTPServerApp.c | 2 | ||||
-rw-r--r-- | Projects/Webserver/Lib/TELNETServerApp.c | 6 | ||||
-rw-r--r-- | Projects/Webserver/Lib/uIPManagement.c | 18 |
3 files changed, 7 insertions, 19 deletions
diff --git a/Projects/Webserver/Lib/HTTPServerApp.c b/Projects/Webserver/Lib/HTTPServerApp.c index 635a3076c..081207c6b 100644 --- a/Projects/Webserver/Lib/HTTPServerApp.c +++ b/Projects/Webserver/Lib/HTTPServerApp.c @@ -198,7 +198,7 @@ static void HTTPServerApp_SendResponseHeader(void) uip_tcp_appstate_t* const AppState = &uip_conn->appstate;
char* const AppData = (char*)uip_appdata;
- char* HeaderToSend;
+ char* HeaderToSend;
/* Determine which HTTP header should be sent to the client */
if (AppState->HTTPServer.FileOpen)
diff --git a/Projects/Webserver/Lib/TELNETServerApp.c b/Projects/Webserver/Lib/TELNETServerApp.c index 720f7d14c..291351ae8 100644 --- a/Projects/Webserver/Lib/TELNETServerApp.c +++ b/Projects/Webserver/Lib/TELNETServerApp.c @@ -106,7 +106,11 @@ void TELNETServerApp_Callback(void) {
case 'c':
TELNETServerApp_DisplayTCPConnections();
- break;
+ break;
+ default:
+ strcpy(AppData, "Invalid Command.\r\n");
+ uip_send(AppData, strlen(AppData));
+ break;
}
AppState->TELNETServer.NextState = TELNET_STATE_SendMenu;
diff --git a/Projects/Webserver/Lib/uIPManagement.c b/Projects/Webserver/Lib/uIPManagement.c index 1b94e8afa..37080dfd7 100644 --- a/Projects/Webserver/Lib/uIPManagement.c +++ b/Projects/Webserver/Lib/uIPManagement.c @@ -52,7 +52,7 @@ void uIPManagement_Init(void) {
/* uIP Timing Initialization */
clock_init();
- timer_set(&ConnectionTimer, CLOCK_SECOND / 8);
+ timer_set(&ConnectionTimer, CLOCK_SECOND / 10);
timer_set(&ARPTimer, CLOCK_SECOND * 10);
/* uIP Stack Initialization */
@@ -175,22 +175,6 @@ static void uIPManagement_ProcessIncommingPacket(void) /** Manages the currently open network connections, including TCP and (if enabled) UDP. */
static void uIPManagement_ManageConnections(void)
{
-#if 0
- /* Poll TCP connections for more data to send back to the host */
- for (uint8_t i = 0; i < UIP_CONNS; i++)
- {
- uip_poll_conn(&uip_conns[i]);
-
- /* If a response was generated, send it */
- if (uip_len > 0)
- {
- /* Add destination MAC to outgoing packet */
- uip_arp_out();
-
- RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface, uip_buf, uip_len);
- }
- }
-#endif
/* Manage open connections for timeouts */
if (timer_expired(&ConnectionTimer))
{
|