lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] STM32F4 LwIP HTTP Ethernet Bootloader (IAP)


From: Müller , Martin , KN
Subject: Re: [lwip-users] STM32F4 LwIP HTTP Ethernet Bootloader (IAP)
Date: Wed, 5 Feb 2014 12:25:58 +0000

Hi Robin,

Thanks for your fast answer. As conclusion, I'll show you my debug stream:

Let's cause the following case: While flashing packet 1, the Bootloader detects 
a wrong checksum. It sends the ErrorPage and when it is confirmed by tcp_sent() 
callback, it closes the connection. But this seems to take too long, because 
the browser client won't stop sending tcp-packets. This is a problem, because 
when sending a larger file (~1500 packets) it paralyses the server so that the 
browser cannot display the ErrorPage immediately. 

Do you mean sending the errorpage with FIN-Flag set? How is this possible?

Thank you very much,

Martin

tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
Bootloader 2: Erasing Flash ... Done. Time: 4531 ms.<\n>
Bootloader 2: Flashing packet 1 ...Parser: Line: 345, Checksum: 0xf3 ERROR! <\n>
Process stopped.<\n>
tcp_close: closing in State: ESTABLISHED<\n>
**** PLEASE STOP HERE, but it won't ;( ****
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
tcp_recved: recveived 1460 bytes, wnd 5840 (0).<\n>
TCP connection closed: FIN_WAIT_2 52638 -> 80.<\n>
tcp_pcb_purge<\n>
tcp_recved: recveived 932 bytes, wnd 5839 (1).<\n>
tcp_close: closing in State: TIME_WAIT<\n>
tcp_slowtmr: no active pcbs<\n>

-----Ursprüngliche Nachricht-----
Von: Robin Iddon [mailto:address@hidden 
Gesendet: Mittwoch, 5. Februar 2014 09:36
An: Müller, Martin, KN
Betreff: Re: [lwip-users] STM32F4 LwIP HTTP Ethernet Bootloader (IAP)

Hi,

I suspect you just write the Http error response then shutdown the write 
connection (in other words send FIN) and discard any subsequent read data.  
Whether or not the client stops sending at this point is up to them.  If after 
a short period of time (say 5 seconds) it hasn't stopped or closed the 
connection then close the connection from your end.

In the first scenario your client will see PSH then FIN and might use this to 
stop sending, respond with its own FIN and render a reasonable error message 
(perhaps one you include in the response).

If it does not then after 5 seconds it will see RST which will trigger an io 
exception of some sort and force it to stop less gracefully, as you have 
already observed.

That's my understanding of it, anyway.

Robin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]