Merge pull request #340 from utoni/fix/sslh-select

changed `select(nfds, ...)` to `select(nfds + 1, ...)`, see `man 2 select`
This commit is contained in:
Yves Rutschle 2022-08-19 18:00:25 +02:00 committed by GitHub
commit 79c8af6ed1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,9 +143,9 @@ void main_loop(struct listen_endpoint listen_sockets[], int num_addr_listen)
memcpy(&readfds, &fd_info.watchers->fds_r, sizeof(readfds));
memcpy(&writefds, &fd_info.watchers->fds_w, sizeof(writefds));
print_message(msg_fd, "selecting... max_fd=%d num_probing=%d\n",
print_message(msg_fd, "selecting... max_fd=%d num_probing=%d\n",
fd_info.watchers->max_fd, fd_info.num_probing);
res = select(fd_info.watchers->max_fd, &readfds, &writefds,
res = select(fd_info.watchers->max_fd + 1, &readfds, &writefds,
NULL, fd_info.num_probing ? &tv : NULL);
if (res < 0)
perror("select");