Browse Source

Fix 100% cpu usage if time() < 0 (thx to gaspa and cate, fixes #1964)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2532 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.23
Stefan Bühler 13 years ago
parent
commit
60e745695a
  1. 1
      NEWS
  2. 8
      src/connections.c
  3. 3
      tests/docroot/www/Makefile.am

1
NEWS

@ -54,6 +54,7 @@ NEWS
* Adding support for additional chars in LDAP usernames (fixes #1941)
* Ignore multiple "If-None-Match" headers (only use first one, fixes #753)
* Add X-Sendfile-Range feature (fixes #2005)
* Fix 100% cpu usage if time() < 0 (thx to gaspa and cate, fixes #1964)
- 1.4.22 - 2009-03-07
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)

8
src/connections.c

@ -1183,7 +1183,7 @@ static handler_t connection_handle_fdevent(void *s, void *context, int revents)
/* FIXME: revents = 0x19 still means that we should read from the queue */
if (revents & FDEVENT_HUP) {
if (con->state == CON_STATE_CLOSE) {
con->close_timeout_ts = 0;
con->close_timeout_ts = srv->cur_ts - 2;
} else {
/* sigio reports the wrong event here
*
@ -1252,7 +1252,7 @@ static handler_t connection_handle_fdevent(void *s, void *context, int revents)
} else {
/* nothing to read */
con->close_timeout_ts = 0;
con->close_timeout_ts = srv->cur_ts - 2;
}
}
@ -1604,10 +1604,10 @@ int connection_state_machine(server *srv, connection *con) {
} else {
/* nothing to read */
con->close_timeout_ts = 0;
con->close_timeout_ts = srv->cur_ts - 2;
}
} else {
con->close_timeout_ts = 0;
con->close_timeout_ts = srv->cur_ts - 2;
}
if (srv->cur_ts - con->close_timeout_ts > 1) {

3
tests/docroot/www/Makefile.am

@ -1,5 +1,6 @@
EXTRA_DIST=cgi.php cgi.pl index.html index.txt phpinfo.php \
redirect.php cgi-pathinfo.pl get-env.php get-server-env.php \
nph-status.pl prefix.fcgi get-header.pl ssi.shtml get-post-len.pl \
exec-date.shtml 404.fcgi 404.html 404.pl send404.pl crlfcrash.pl
exec-date.shtml 404.fcgi 404.html 404.pl send404.pl crlfcrash.pl \
sendfile.php
SUBDIRS=go indexfile expire

Loading…
Cancel
Save