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.

pull/1469/head
Dean Camera 15 years ago
parent 7d3ed40070
commit f4f44f9fc1

@ -175,6 +175,21 @@ static void uIPManagement_ProcessIncommingPacket(void)
/** Manages the currently open network connections, including TCP and (if enabled) UDP. */ /** Manages the currently open network connections, including TCP and (if enabled) UDP. */
static void uIPManagement_ManageConnections(void) 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 */ /* Manage open connections for timeouts */
if (timer_expired(&ConnectionTimer)) if (timer_expired(&ConnectionTimer))
{ {

@ -689,6 +689,7 @@ uip_process(u8_t flag)
if(flag == UIP_POLL_REQUEST) { if(flag == UIP_POLL_REQUEST) {
if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED && if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED &&
!uip_outstanding(uip_connr)) { !uip_outstanding(uip_connr)) {
uip_len = uip_slen = 0;
uip_flags = UIP_POLL; uip_flags = UIP_POLL;
UIP_APPCALL(); UIP_APPCALL();
goto appsend; goto appsend;
@ -794,6 +795,7 @@ uip_process(u8_t flag)
} else if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED) { } else if((uip_connr->tcpstateflags & UIP_TS_MASK) == UIP_ESTABLISHED) {
/* If there was no need for a retransmission, we poll the /* If there was no need for a retransmission, we poll the
application for new data. */ application for new data. */
uip_len = uip_slen = 0;
uip_flags = UIP_POLL; uip_flags = UIP_POLL;
UIP_APPCALL(); UIP_APPCALL();
goto appsend; goto appsend;

Loading…
Cancel
Save