On Tue, Sep 29, 2026 at 01:35:29AM +0300, Vitaliy Sochnev wrote:
> The lwIP httpd has no way to stop: its listening PCB and callbacks
> outlive the caller. With the shared lwIP runtime the server would keep
> accepting connections while any other client polls the network.
> 
> Add httpd_deinit(), which aborts the open connections and closes the
> listening PCB. Open connections are only tracked with
> LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED.
> 
> With SO_REUSE, set SOF_REUSEADDR on the listening PCB: connections
> closed by the server stay in TIME-WAIT and would make the next bind
> fail.
> 
> Signed-off-by: Vitaliy Sochnev <[email protected]>
> ---
>  lib/lwip/lwip/src/apps/http/httpd.c         | 51 ++++++++++++++++++++-
>  lib/lwip/lwip/src/include/lwip/apps/httpd.h |  1 +
>  2 files changed, 50 insertions(+), 2 deletions(-)

I'm a little wary of adding code to upstream lwIP here. Have you
submitted this there as well?

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to