From 1321b5e9b11116f961b222a2e142701ff353e9cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juho=20V=C3=A4h=C3=A4-Herttua?= Date: Sun, 25 Nov 2012 18:58:14 +0200 Subject: [PATCH] Close server sockets on shutdown, thanks to Memphiz for pointing this out. --- src/lib/httpd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/httpd.c b/src/lib/httpd.c index 88971fa..dfd3d6b 100644 --- a/src/lib/httpd.c +++ b/src/lib/httpd.c @@ -326,6 +326,16 @@ httpd_thread(void *arg) httpd_remove_connection(httpd, connection); } + /* Close server sockets since they are not used any more */ + if (httpd->server_fd4 != -1) { + closesocket(httpd->server_fd4); + httpd->server_fd4 = -1; + } + if (httpd->server_fd6 != -1) { + closesocket(httpd->server_fd6); + httpd->server_fd6 = -1; + } + logger_log(httpd->logger, LOGGER_INFO, "Exiting HTTP thread"); return 0; -- 2.34.1