From 832ff277f2c8d4cdb512170caa31a67703eaa6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Tue, 3 Feb 2009 21:02:18 +0000 Subject: [PATCH] Remove floating point math from server.c (fixes #1402) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2381 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/server.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index d4cc381c..2c7c538c 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ NEWS * Do not pass Proxy-Connection: header from client to backend http server in mod_proxy (#1877) * Fix wrong malloc sizes in mod_accesslog (probably nothing bad happened...) (fixes #1855, thx ycheng) * Some small buffer.c fixes (closes #1837) + * Remove floating point math from server.c (fixes #1402) - 1.4.20 - 2008-09-30 diff --git a/src/server.c b/src/server.c index d20c1c3b..92d79cd8 100644 --- a/src/server.c +++ b/src/server.c @@ -1295,7 +1295,7 @@ int main (int argc, char **argv) { if (srv->sockets_disabled) { /* our server sockets are disabled, why ? */ - if ((srv->cur_fds + srv->want_fds < srv->max_fds * 0.8) && /* we have enough unused fds */ + if ((srv->cur_fds + srv->want_fds < srv->max_fds * 8 / 10) && /* we have enough unused fds */ (srv->conns->used < srv->max_conns * 0.9) && (0 == graceful_shutdown)) { for (i = 0; i < srv->srv_sockets.used; i++) { @@ -1308,7 +1308,7 @@ int main (int argc, char **argv) { srv->sockets_disabled = 0; } } else { - if ((srv->cur_fds + srv->want_fds > srv->max_fds * 0.9) || /* out of fds */ + if ((srv->cur_fds + srv->want_fds > srv->max_fds * 9 / 10) || /* out of fds */ (srv->conns->used > srv->max_conns) || /* out of connections */ (graceful_shutdown)) { /* graceful_shutdown */