Unix: Substituted select -> poll also in congestion checker
It does strange things when even one fd larger than FD_SETSIZE is passed to select().
This commit is contained in:
parent
fd926ed4ee
commit
9c92f69272
1 changed files with 3 additions and 10 deletions
|
@ -1679,19 +1679,12 @@ sk_maybe_write(sock *s)
|
|||
int
|
||||
sk_rx_ready(sock *s)
|
||||
{
|
||||
fd_set rd, wr;
|
||||
struct timeval timo;
|
||||
int rv;
|
||||
|
||||
FD_ZERO(&rd);
|
||||
FD_ZERO(&wr);
|
||||
FD_SET(s->fd, &rd);
|
||||
|
||||
timo.tv_sec = 0;
|
||||
timo.tv_usec = 0;
|
||||
struct pollfd pfd = { .fd = s->fd };
|
||||
pfd.events |= POLLIN;
|
||||
|
||||
redo:
|
||||
rv = select(s->fd+1, &rd, &wr, NULL, &timo);
|
||||
rv = poll(&pfd, 1, 0);
|
||||
|
||||
if ((rv < 0) && (errno == EINTR || errno == EAGAIN))
|
||||
goto redo;
|
||||
|
|
Loading…
Reference in a new issue