cosmetic change (keep lib free of UxPlay mentions in case of re-use)

make NOHOLD feature a #define item
This commit is contained in:
F. Duncanh
2022-12-16 10:23:09 -05:00
parent a5f2ba39b2
commit 584dadb5da
4 changed files with 12 additions and 6 deletions

View File

@@ -172,7 +172,8 @@ httpd_accept_connection(httpd_t *httpd, int server_fd, int is_ipv6)
local = netutils_get_address(&local_saddr, &local_len);
remote = netutils_get_address(&remote_saddr, &remote_len);
/* for uxplay, remove existing connections to make way for new connections:
#ifdef NOHOLD
/* remove existing connections to make way for new connections:
* this will only occur if max_connections > 2 */
if (httpd->open_connections >= 2) {
logger_log(httpd->logger, LOGGER_INFO, "Destroying current connections to allow connection by new client");
@@ -184,7 +185,8 @@ httpd_accept_connection(httpd_t *httpd, int server_fd, int is_ipv6)
httpd_remove_connection(httpd, connection);
}
}
#endif
ret = httpd_add_connection(httpd, fd, local, local_len, remote, remote_len);
if (ret == -1) {
shutdown(fd, SHUT_RDWR);