Never use select() when poll() is available
authorFabian Keil <fk@fabiankeil.de>
Thu, 25 May 2017 11:16:56 +0000 (11:16 +0000)
committerFabian Keil <fk@fabiankeil.de>
Thu, 25 May 2017 11:16:56 +0000 (11:16 +0000)
commita40aa0237d6ef1be4c333260f71403ac931008bc
treec988d92aee50495c822937e6745e4a42fedb4c22
parent332f3d30ce283c8402e1830e965089563e9e62d5
Never use select() when poll() is available

On most platforms select() is limitted by FD_SETSIZE while
poll() is not. This was a scaling issue for multi-user setups.

Using poll() has no downside other than the usual risk
that code modifications may introduce new bugs that have
yet to be found and fixed.

At least in theory this commit could also reduce the latency
when there are lots of connections and select() would use
"bit fields in arrays of integers" to store file descriptors.

Another side effect is that Privoxy no longer has to stop
monitoring the client sockets when pipelined requests are
waiting but can't be read yet.

This code keeps the select()-based code behind ifdefs for
now but hopefully it can be removed soonish to make the
code more readable.

Sponsored by: Robert Klemme
jbsockets.c
jcc.c
loadcfg.c