diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-02-03 14:09:56 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2010-02-03 14:09:56 +0000 |
| commit | ca954b9f1a6d89e97b36fd4b0a4fdf397e47ba78 (patch) | |
| tree | 6eb9d93748b655d5b3e69249b8248ce29cc689e4 /Projects | |
| parent | 46ef3feb51f518bed734a6374babce6aef8bb0df (diff) | |
Re-add Webserver uIP application polling, apply patch to uIP by Andrew Ruder to fix corrupt TCP streams when multiple applications are used and the applications are polled for more data.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1109 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects')
| -rw-r--r-- | Projects/Webserver/Lib/uIPManagement.c | 15 | ||||
| -rw-r--r-- | Projects/Webserver/Lib/uip/uip.c | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/Projects/Webserver/Lib/uIPManagement.c b/Projects/Webserver/Lib/uIPManagement.c index 37080dfd..90629b89 100644 --- a/Projects/Webserver/Lib/uIPManagement.c +++ b/Projects/Webserver/Lib/uIPManagement.c @@ -175,6 +175,21 @@ static void uIPManagement_ProcessIncommingPacket(void) /** Manages the currently open network connections, including TCP and (if enabled) UDP. */
static void uIPManagement_ManageConnections(void)
{
+ /* 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);
+ }
+ }
+
/* Manage open connections for timeouts */
if (timer_expired(&ConnectionTimer))
{
diff --git a/Projects/Webserver/Lib/uip/uip.c b/Projects/Webserver/Lib/uip/uip.c index 1abefd5d..22a72043 100644 --- a/Projects/Webserver/Lib/uip/uip.c +++ b/Projects/Webserver/Lib/uip/uip.c @@ -689,6 +689,7 @@ uip_process(u8_t flag) if(flag == UIP_POLL_REQUEST) { if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED && !uip_outstanding(uip_connr)) { + uip_len = uip_slen = 0; uip_flags = UIP_POLL; UIP_APPCALL(); goto appsend; @@ -794,6 +795,7 @@ uip_process(u8_t flag) } else if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED) { /* If there was no need for a retransmission, we poll the application for new data. */ + uip_len = uip_slen = 0; uip_flags = UIP_POLL; UIP_APPCALL(); goto appsend; |
