[BUG] reject unix accepts when connection limit is reached
unix sockets are not attached to a real frontend, so there is
no way to disable/enable the listener depending on the global
session count. For this reason, if the global maxconn is reached
and a unix socket comes in, it will just be ignored and remain
in the poll list, which will call again indefinitely.
So we need to accept then drop incoming unix connections when
the table is full.
This should not happen with clean configurations since the global
maxconn should provide enough room for unix sockets.
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 599252a..8af3d5a 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -368,7 +368,7 @@
else
max_accept = -1;
- while (actconn < global.maxconn && max_accept--) {
+ while (max_accept--) {
struct sockaddr_storage addr;
socklen_t laddr = sizeof(addr);
@@ -393,7 +393,7 @@
}
}
- if (l->nbconn >= l->maxconn) {
+ if (l->nbconn >= l->maxconn || actconn >= global.maxconn) {
/* too many connections, we shoot this one and return.
* FIXME: it would be better to simply switch the listener's
* state to LI_FULL and disable the FD. We could re-enable