Re-add Webserver uIP application polling, apply patch to uIP by Andrew Ruder to fix...
authorDean Camera <dean@fourwalledcubicle.com>
Wed, 3 Feb 2010 14:09:56 +0000 (14:09 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Wed, 3 Feb 2010 14:09:56 +0000 (14:09 +0000)
Projects/Webserver/Lib/uIPManagement.c
Projects/Webserver/Lib/uip/uip.c

index 37080df..90629b8 100644 (file)
@@ -175,6 +175,21 @@ 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
+       /* 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
+\r
        /* Manage open connections for timeouts */\r
        if (timer_expired(&ConnectionTimer))\r
        {\r
index 1abefd5..22a7204 100644 (file)
@@ -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;