remove FD_SETSIZE check

This commit is contained in:
Jethro Grassie 2019-11-29 20:03:11 -05:00
parent b790700c32
commit bea8068bd9
No known key found for this signature in database
GPG key ID: DE8ED755616565BB

View file

@ -2586,21 +2586,15 @@ client_on_accept(evutil_socket_t listener, short event, void *arg)
if (fd < 0) if (fd < 0)
{ {
perror("accept"); perror("accept");
return;
} }
else if (fd > FD_SETSIZE) struct bufferevent *bev;
{ evutil_make_socket_nonblocking(fd);
close(fd); bev = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE);
} bufferevent_setcb(bev, client_on_read, NULL, client_on_error, NULL);
else bufferevent_setwatermark(bev, EV_READ, 0, MAX_LINE);
{ bufferevent_enable(bev, EV_READ|EV_WRITE);
struct bufferevent *bev; client_add(fd, bev);
evutil_make_socket_nonblocking(fd);
bev = bufferevent_socket_new(base, fd, BEV_OPT_CLOSE_ON_FREE);
bufferevent_setcb(bev, client_on_read, NULL, client_on_error, NULL);
bufferevent_setwatermark(bev, EV_READ, 0, MAX_LINE);
bufferevent_enable(bev, EV_READ|EV_WRITE);
client_add(fd, bev);
}
} }
static void static void