diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-02-12 07:54:28 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-02-12 07:54:28 +0000 |
commit | c6f21fde628193c7957d84792215ecaa14d5beb7 (patch) | |
tree | 9aa760996ff2f126414f32fce7ff65d426556851 /Projects/Webserver/Lib/TELNETServerApp.c | |
parent | 8154331da60ac08b0e2b09ca67008ec4a8c7698b (diff) | |
download | lufa-c6f21fde628193c7957d84792215ecaa14d5beb7.tar.gz lufa-c6f21fde628193c7957d84792215ecaa14d5beb7.tar.bz2 lufa-c6f21fde628193c7957d84792215ecaa14d5beb7.zip |
Speed up Webserver demo data rate by not sending a full ethernet frame each time, preventing the receiver from using a delayed ACK scheme which slows down the connection. TELNET server cleanup.
Diffstat (limited to 'Projects/Webserver/Lib/TELNETServerApp.c')
-rw-r--r-- | Projects/Webserver/Lib/TELNETServerApp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Projects/Webserver/Lib/TELNETServerApp.c b/Projects/Webserver/Lib/TELNETServerApp.c index 7d8c907fe..2abd7b0ed 100644 --- a/Projects/Webserver/Lib/TELNETServerApp.c +++ b/Projects/Webserver/Lib/TELNETServerApp.c @@ -31,7 +31,7 @@ /** \file
*
* TELNET Webserver Application. When connected to the uIP stack,
- * this will serve out connection information to the client.
+ * this will serve out raw TELNET to the client on port 23.
*/
#define INCLUDE_FROM_TELNETSERVERAPP_C
@@ -44,9 +44,13 @@ const char PROGMEM WelcomeHeader[] = "****************************************** /** Main TELNET menu, giving the user the list of available commands they may issue */
const char PROGMEM TELNETMenu[] = "\r\n"
- " Available Commands:\r\n"
+ " == Available Commands: ==\r\n"
" c) List Active TCP Connections\r\n"
- "\r\nCommand>";
+ " =========================\r\n"
+ "\r\n>";
+
+/** Header to print before the current connections are printed to the client */
+const char PROGMEM CurrentConnectionsHeader = "\r\n* Current TCP Connections: *\r\n";
/** Initialization function for the simple HTTP webserver. */
void TELNETServerApp_Init(void)
@@ -65,11 +69,13 @@ void TELNETServerApp_Callback(void) if (uip_connected())
{
+ /* New connection - initialize connection state values */
AppState->TELNETServer.CurrentState = TELNET_STATE_SendHeader;
}
if (uip_acked())
{
+ /* Progress to the next state once the current state's data has been ACKed */
AppState->TELNETServer.CurrentState = AppState->TELNETServer.NextState;
}
@@ -124,7 +130,7 @@ static void TELNETServerApp_DisplayTCPConnections(void) {
char* const AppData = (char*)uip_appdata;
- strcpy(AppData, "\r\n* Current TCP Connections: *\r\n");
+ strcpy_P(AppData, CurrentConnectionsHeader);
uint16_t ResponseLen = strlen(AppData);
uint8_t ActiveConnCount = 0;
|