r2087@chromobil: stefan | 2008-02-26 17:01:12 +0100

Fix #1562 and try re-fixing #372: out of range access in fd array
 
  - Bug is in original #372 fix [853]
  - The re-fix for #372 is not tested:
    the problem is that Solaris doesn't want to poll for maxfds (ulimit) events,
    as at least one filedescriptor is used for the poll device.
    So the solution is to just ask for one event less; the number of events
    actually available is returned by the poll syscall, so it should work.
 


git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2082 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.19
Stefan Bühler 15 years ago
parent d0862e8522
commit 796502e7af
  1. 2
      src/fdevent_solaris_devpoll.c
  2. 3
      src/server.c

@ -67,7 +67,7 @@ static int fdevent_solaris_devpoll_poll(fdevents *ev, int timeout_ms) {
int ret;
dopoll.dp_timeout = timeout_ms;
dopoll.dp_nfds = ev->maxfds;
dopoll.dp_nfds = ev->maxfds - 1;
dopoll.dp_fds = ev->devpollfds;
ret = ioctl(ev->devpoll_fd, DP_POLL, &dopoll);

@ -697,9 +697,6 @@ int main (int argc, char **argv) {
}
}
/* #372: solaris need some fds extra for devpoll */
if (rlim.rlim_cur > 10) rlim.rlim_cur -= 10;
if (srv->event_handler == FDEVENT_HANDLER_SELECT) {
srv->max_fds = rlim.rlim_cur < FD_SETSIZE - 200 ? rlim.rlim_cur : FD_SETSIZE - 200;
} else {

Loading…
Cancel
Save