Windows understands FD_SETSIZE as POSIX does but unlike Linux (and likely
*BSD) does. While Linux uses the value to mark the highest value of a
filehandle, Windows understands it as the number of handles.
When select(2) is used we only support as many file handles as
there is space in fd_set. The limit is given in FD_SETSIZE.
Once we use filehandles with an value >= FD_SETSIZE we might
end up corrupting memory. Therefore we try to avoid those calls
by rejecting handles >= FD_SETSIZE very early.
This patch should keep most problems away. However it does not
actually ensure we don't corrupt memory. That check has been skipped
for performance reasons. Keeping in mind that the use of select(2)
is already deprecated.
This adds on-behalf-of="#id" to <listen-socket>. It allows a socket
to handle the traffic that was originally meant of another (virtual)
listen socket.
This moves all the listen socket code into a nice and abstracting file.
Notes:
* Altering listen socket setup does not yet work on config reload.
(Did it ever work?)
* Server will start with no listen sockets. (There are unconfirmed
rumours it sometimes(?) did before.) This is to be re-implemented
in another commit. It can also be improved to work allow checking
on reload or other config changes.
* For slave connections the server address is now checked against
the allow/deny-IP list.