Peter Woo <[email protected]> wrote: > After this change, web clients now receive "connection reset" errors upon > visiting a page. I've gotten it to work if the entire response is written > in > one lwip_send() call, but if for instance the header is written in a > different call than the message body then the "connection reset" error > occurs (I've checked this with a few browsers).
You should be aware the tcp_close (which gets called from lwip_close) sends a RST (since 1.4.0) if at the time of closing, there is data unread by your application. This is to ensure the remote host knows the connection hasn't been closed gracefully (since your side did not read everything the remote host thought it would). In webservers, it's a common mistake to not read the full request. I could imagine this being the reason: if the browser sends the request in multiple packets and you are fast at calling lwip_send/lwip_close after parsing the first packet, lwIP might not know of unread data while it does so later (when using 2 lwip_send calls). Just an idea, though. To further debug this, set a breakpoint in tcp_rst_impl() and see from where/why it is called. Simon -- Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
