aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/Webserver/Lib/HTTPServerApp.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-02-12 07:54:28 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-02-12 07:54:28 +0000
commitc6f21fde628193c7957d84792215ecaa14d5beb7 (patch)
tree9aa760996ff2f126414f32fce7ff65d426556851 /Projects/Webserver/Lib/HTTPServerApp.c
parent8154331da60ac08b0e2b09ca67008ec4a8c7698b (diff)
downloadlufa-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/HTTPServerApp.c')
-rw-r--r--Projects/Webserver/Lib/HTTPServerApp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Projects/Webserver/Lib/HTTPServerApp.c b/Projects/Webserver/Lib/HTTPServerApp.c
index e781beb22..0d0cbb903 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);