Browse Source

Use/enforce sane max-connection values (fixes #1803)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2383 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.21
Stefan Bühler 13 years ago
parent
commit
4456b579b7
  1. 1
      NEWS
  2. 11
      src/server.c

1
NEWS

@ -29,6 +29,7 @@ NEWS
* Some small buffer.c fixes (closes #1837)
* Remove floating point math from server.c (fixes #1402)
* Disable SSLv2 by default
* Use/enforce sane max-connection values (fixes #1803)
- 1.4.20 - 2008-09-30

11
src/server.c

@ -844,15 +844,16 @@ int main (int argc, char **argv) {
}
/* set max-conns */
if (srv->srvconf.max_conns > srv->max_fds) {
/* we can't have more connections than max-fds */
srv->max_conns = srv->max_fds;
if (srv->srvconf.max_conns > srv->max_fds/2) {
/* we can't have more connections than max-fds/2 */
log_error_write(srv, __FILE__, __LINE__, "sdd", "can't have more connections than fds/2: ", srv->srvconf.max_conns, srv->max_fds);
srv->max_conns = srv->max_fds/2;
} else if (srv->srvconf.max_conns) {
/* otherwise respect the wishes of the user */
srv->max_conns = srv->srvconf.max_conns;
} else {
/* or use the default */
srv->max_conns = srv->max_fds;
/* or use the default: we really don't want to hit max-fds */
srv->max_conns = srv->max_fds/3;
}
if (HANDLER_GO_ON != plugins_call_init(srv)) {

Loading…
Cancel
Save