BUG/MINOR: config: don't over-count the global maxsock value
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Feb 2019 15:25:28 +0000 (16:25 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Feb 2019 18:35:37 +0000 (19:35 +0100)
commit18215cba6a51e88bbd4c0f993ffcebfd92d43a47
tree00a7f931d4bc32bd086dc5a6d61daa2b62856b24
parent3f36448e1747211d0f56a0817c96b0b7c8bcf96d
BUG/MINOR: config: don't over-count the global maxsock value

global.maxsock used to be augmented by the frontend's maxconn value
for each frontend listener, which is absurd when there are many
listeners in a frontend because the frontend's maxconn fixes an
upper limit to how many connections will be accepted on all of its
listeners anyway. What is needed instead is to add one to count the
listening socket.

In addition, the CLI's and peers' value was incremented twice, the
first time when creating the listener and the second time in the
main init code.

Let's now make sure we only increment global.maxsock by the required
amount of sockets. This means not adding maxconn for each listener,
and relying on the global values when they are correct.
src/cfgparse.c
src/cli.c