mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 23:56:57 +02:00
MINOR: polling: make epoll and kqueue not depend on maxfd anymore
Maxfd is really only useful to poll() and select(), yet epoll and kqueue reference it almost by mistake : - cloning of the initial FDs (maxsock should be used here) - max polled events, it's maxpollevents which should be used here. Let's fix these places.
This commit is contained in:
parent
ccea35c980
commit
ce036bc2da
@ -206,7 +206,7 @@ static int init_epoll_per_thread()
|
|||||||
* fd for this thread. Let's just mark them as updated, the poller will
|
* fd for this thread. Let's just mark them as updated, the poller will
|
||||||
* do the rest.
|
* do the rest.
|
||||||
*/
|
*/
|
||||||
for (fd = 0; fd < maxfd; fd++)
|
for (fd = 0; fd < global.maxsock; fd++)
|
||||||
updt_fd_polling(fd);
|
updt_fd_polling(fd);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -110,7 +110,7 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
|
|||||||
else
|
else
|
||||||
activity[tid].poll_exp++;
|
activity[tid].poll_exp++;
|
||||||
|
|
||||||
fd = MIN(maxfd, global.tune.maxpollevents);
|
fd = global.tune.maxpollevents;
|
||||||
gettimeofday(&before_poll, NULL);
|
gettimeofday(&before_poll, NULL);
|
||||||
status = kevent(kqueue_fd[tid], // int kq
|
status = kevent(kqueue_fd[tid], // int kq
|
||||||
NULL, // const struct kevent *changelist
|
NULL, // const struct kevent *changelist
|
||||||
@ -172,7 +172,7 @@ static int init_kqueue_per_thread()
|
|||||||
* fd for this thread. Let's just mark them as updated, the poller will
|
* fd for this thread. Let's just mark them as updated, the poller will
|
||||||
* do the rest.
|
* do the rest.
|
||||||
*/
|
*/
|
||||||
for (fd = 0; fd < maxfd; fd++)
|
for (fd = 0; fd < global.maxsock; fd++)
|
||||||
updt_fd_polling(fd);
|
updt_fd_polling(fd);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user