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)
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


No differences found