From: Juho Vähä-Herttua Date: Sun, 25 Nov 2012 16:58:14 +0000 (+0200) Subject: Close server sockets on shutdown, thanks to Memphiz for pointing this out. X-Git-Tag: upstream/0.9.0~4^2~48 X-Git-Url: https://git.piment-noir.org/?p=deb_shairplay.git;a=commitdiff_plain;h=1321b5e9b11116f961b222a2e142701ff353e9cc Close server sockets on shutdown, thanks to Memphiz for pointing this out. --- 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;