Fix TELNET server locking up if an invalid command was issued.
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 3 Feb 2010 13:08:37 +0000 (13:08 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Wed, 3 Feb 2010 13:08:37 +0000 (13:08 +0000)
Projects/Webserver/Lib/HTTPServerApp.c
Projects/Webserver/Lib/TELNETServerApp.c
Projects/Webserver/Lib/uIPManagement.c

index 635a307..081207c 100644 (file)
@@ -198,7 +198,7 @@ static void HTTPServerApp_SendResponseHeader(void)
        uip_tcp_appstate_t* const AppState    = &uip_conn->appstate;\r
        char*               const AppData     = (char*)uip_appdata;\r
 \r
-       char*    HeaderToSend;\r
+       char* HeaderToSend;\r
 \r
        /* Determine which HTTP header should be sent to the client */\r
        if (AppState->HTTPServer.FileOpen)\r
index 720f7d1..291351a 100644 (file)
@@ -106,7 +106,11 @@ void TELNETServerApp_Callback(void)
                                {\r
                                        case 'c':\r
                                                TELNETServerApp_DisplayTCPConnections();\r
-                                               break;                                  \r
+                                               break;\r
+                                       default:\r
+                                               strcpy(AppData, "Invalid Command.\r\n");\r
+                                               uip_send(AppData, strlen(AppData));\r
+                                               break;\r
                                }\r
 \r
                                AppState->TELNETServer.NextState = TELNET_STATE_SendMenu;\r
index 1b94e8a..37080df 100644 (file)
@@ -52,7 +52,7 @@ void uIPManagement_Init(void)
 {\r
        /* uIP Timing Initialization */\r
        clock_init();\r
-       timer_set(&ConnectionTimer, CLOCK_SECOND / 8);\r
+       timer_set(&ConnectionTimer, CLOCK_SECOND / 10);\r
        timer_set(&ARPTimer, CLOCK_SECOND * 10);        \r
 \r
        /* uIP Stack Initialization */\r
@@ -175,22 +175,6 @@ static void uIPManagement_ProcessIncommingPacket(void)
 /** Manages the currently open network connections, including TCP and (if enabled) UDP. */\r
 static void uIPManagement_ManageConnections(void)\r
 {\r
-#if 0\r
-       /* Poll TCP connections for more data to send back to the host */\r
-       for (uint8_t i = 0; i < UIP_CONNS; i++)\r
-       {\r
-               uip_poll_conn(&uip_conns[i]);\r
-\r
-               /* If a response was generated, send it */\r
-               if (uip_len > 0)\r
-               {\r
-                       /* Add destination MAC to outgoing packet */\r
-                       uip_arp_out();\r
-\r
-                       RNDIS_Host_SendPacket(&Ethernet_RNDIS_Interface, uip_buf, uip_len);\r
-               }\r
-       }\r
-#endif\r
        /* Manage open connections for timeouts */\r
        if (timer_expired(&ConnectionTimer))\r
        {\r