From c6f21fde628193c7957d84792215ecaa14d5beb7 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Fri, 12 Feb 2010 07:54:28 +0000 Subject: 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. --- Projects/Webserver/Lib/HTTPServerApp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Projects/Webserver/Lib/HTTPServerApp.c') diff --git a/Projects/Webserver/Lib/HTTPServerApp.c b/Projects/Webserver/Lib/HTTPServerApp.c index e781beb220..0d0cbb9033 100644 --- a/Projects/Webserver/Lib/HTTPServerApp.c +++ b/Projects/Webserver/Lib/HTTPServerApp.c @@ -31,7 +31,7 @@ /** \file * * Simple HTTP Webserver Application. When connected to the uIP stack, - * this will serve out files to HTTP clients. + * this will serve out files to HTTP clients on port 80. */ #define INCLUDE_FROM_HTTPSERVERAPP_C @@ -270,8 +270,12 @@ static void HTTPServerApp_SendData(void) uip_tcp_appstate_t* const AppState = &uip_conn->appstate; char* const AppData = (char*)uip_appdata; - /* Must determine the maximum segment size to determine maximum file chunk size */ - uint16_t MaxSegmentSize = uip_mss(); + /* Must determine the maximum segment size to determine maximum file chunk size - never send a completely + * full packet, as this will cause some hosts to start delaying ACKs until a non-full packet is received. + * since uIP only allows one packet to be in transit at a time, this would cause long delays between packets + * until the host times out and sends the ACK for the last received packet. + */ + uint16_t MaxSegmentSize = (uip_mss() >> 1); /* Return file pointer to the last ACKed position */ f_lseek(&AppState->HTTPServer.FileHandle, AppState->HTTPServer.ACKedFilePos); -- cgit v1.2.3