lighttpd1.4/src
Glenn Strauss bbbbfb3de0 untangle overly complex control flow logic
for dynamic handlers mod_cgi, mod_fastcgi, mod_scgi, mod_proxy
(mod_cgi control flow logic simplification began in a prior commit)

- connection state machine calls the subrequest handler
- subrequest handler sets up the connection to the backend
  and registers fdevent handler to handle backend events
- fdevent handler handles backend events and then schedules
  a call to connection state machine
- when retrying an alternate backend, backend state is reset
  and then response state is reset so that the connection state
  machine will call back into the subrequest handler to retry

Dynamic handlers no longer directly modify connection state
(calls to connection_set_state() from dynamic handlers were removed)

Dynamic handlers no longer reset con->physical.path, and they
preserve con->mode when retrying alternate backends.  This is done
to skip repeated processing in response.c:http_response_prepare()

While this patch increases consistency in control flow handling,
there is more work to be done that can further improve upon this.

x-ref:
  "handle-req time too long"
  https://redmine.lighttpd.net/issues/1149
2016-04-18 06:19:03 -04:00
..
CMakeLists.txt [unittests] add test_buffer and test_base64 unit tests 2016-03-25 16:58:12 +00:00
Makefile.am [unittests] add test_buffer and test_base64 unit tests 2016-03-25 16:58:12 +00:00
SConscript [core] add generic vector implementation 2016-03-19 15:27:36 +00:00
array.c [core] replace array weakref with vector 2016-03-19 15:27:38 +00:00
array.h [core] replace array weakref with vector 2016-03-19 15:27:38 +00:00
base.h [config] server.listen-backlog option (fixes #1825, #2116) 2016-04-18 04:29:28 -04:00
base64.c [base64] fix another crash due to broken force_assert conditions 2016-03-25 16:58:14 +00:00
base64.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
buffer.c use li_[iu]tostrn() instead of li_[iu]tostr() 2016-04-01 17:38:26 +00:00
buffer.h use li_[iu]tostrn() instead of li_[iu]tostr() 2016-04-01 17:38:26 +00:00
chunk.c [core] retry tempdirs on partial write, ENOSPC (fixes #2588) 2016-04-18 04:30:55 -04:00
chunk.h [core] retry tempdirs on partial write, ENOSPC (fixes #2588) 2016-04-18 04:30:55 -04:00
config.h.cmake use libmemcached instead of deprecated libmemcache 2016-01-03 14:48:11 +00:00
configfile-glue.c [core] replace array weakref with vector 2016-03-19 15:27:38 +00:00
configfile.c [config] server.listen-backlog option (fixes #1825, #2116) 2016-04-18 04:29:28 -04:00
configfile.h [core] replace array weakref with vector 2016-03-19 15:27:38 +00:00
configparser.y [configparser] fix small leak on config failure 2016-03-26 13:57:03 +00:00
connections-glue.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
connections.c [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
connections.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
crc32.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
crc32.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
data_array.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
data_config.c [core] replace array weakref with vector 2016-03-19 15:27:38 +00:00
data_count.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
data_fastcgi.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
data_integer.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
data_string.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
etag.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
etag.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fastcgi.h - white space cleanup part 2 this time 1.4 ;) 2006-10-04 13:26:23 +00:00
fdevent.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fdevent.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fdevent_freebsd_kqueue.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fdevent_libev.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fdevent_linux_sysepoll.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fdevent_poll.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fdevent_select.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fdevent_solaris_devpoll.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
fdevent_solaris_port.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
first.h [core] define __STDC_WANT_LIB_EXT1__ (fixes #2722) 2016-04-13 03:54:04 -04:00
http-header-glue.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
http_auth.c use li_[iu]tostrn() instead of li_[iu]tostr() 2016-04-01 17:38:26 +00:00
http_auth.h pass buf size to li_tohex() 2016-04-01 16:54:46 +00:00
http_chunk.c [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
http_chunk.h [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
inet_ntop_cache.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
inet_ntop_cache.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
joblist.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
joblist.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
keyvalue.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
keyvalue.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
lemon.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
lempar.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
lighttpd-angel.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
log.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
log.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
md5.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
md5.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_access.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_accesslog.c [core] lighttpd -tt performs preflight startup checks (fixes #411) 2016-03-26 13:39:54 +00:00
mod_alias.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_auth.c [mod_auth] send charset="UTF-8" in WWW-Authenticate (fixes #1468) 2016-04-12 23:56:55 -04:00
mod_auth.h moved everything below trunk/ and added branches/ and tags/ 2005-02-20 14:27:00 +00:00
mod_cgi.c untangle overly complex control flow logic 2016-04-18 06:19:03 -04:00
mod_cml.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_cml.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_cml_funcs.c pass buf size to li_tohex() 2016-04-01 16:54:46 +00:00
mod_cml_funcs.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_cml_lua.c [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
mod_compress.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_dirlisting.c [mod_dirlisting] class for dir <tr> (fixes #2304) 2016-04-13 02:18:16 -04:00
mod_evasive.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_evhost.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_expire.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_extforward.c [mod_extforward] reset cond_cache for scheme (fixes #1499) 2016-04-13 00:17:46 -04:00
mod_fastcgi.c untangle overly complex control flow logic 2016-04-18 06:19:03 -04:00
mod_flv_streaming.c [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
mod_indexfile.c [mod_indexfile] save physical path to env (fixes #448, #892) 2016-04-14 16:02:11 -04:00
mod_magnet.c [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
mod_magnet_cache.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_magnet_cache.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_mysql_vhost.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_proxy.c untangle overly complex control flow logic 2016-04-18 06:19:03 -04:00
mod_redirect.c [mod_redirect,mod-rewrite] short-circuit if blank replacement (fixes #2085) 2016-04-14 16:01:45 -04:00
mod_rewrite.c [mod_redirect,mod-rewrite] short-circuit if blank replacement (fixes #2085) 2016-04-14 16:01:45 -04:00
mod_rrdtool.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_scgi.c untangle overly complex control flow logic 2016-04-18 06:19:03 -04:00
mod_secdownload.c pass buf size to li_tohex() 2016-04-01 16:54:46 +00:00
mod_setenv.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_simple_vhost.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_skeleton.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_ssi.c [mod_ssi] config ssi.exec (fixes #2051) 2016-04-14 08:59:07 -04:00
mod_ssi.h [mod_ssi] config ssi.exec (fixes #2051) 2016-04-14 08:59:07 -04:00
mod_ssi_expr.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_ssi_expr.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_ssi_exprparser.y consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_staticfile.c [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
mod_status.c [mod_status] table w/ count of con states (fixes #2427) 2016-04-13 02:12:54 -04:00
mod_trigger_b4_dl.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_uploadprogress.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_userdir.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
mod_usertrack.c use li_[iu]tostrn() instead of li_[iu]tostr() 2016-04-01 17:38:26 +00:00
mod_webdav.c [mod_webdav] readdir POSIX compat (fixes #1826) 2016-04-13 00:23:31 -04:00
network.c [config] server.listen-backlog option (fixes #1825, #2116) 2016-04-18 04:29:28 -04:00
network.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_backends.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_darwin_sendfile.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_freebsd_sendfile.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_linux_sendfile.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_openssl.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_solaris_sendfilev.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_write.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_write_mmap.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_write_no_mmap.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
network_writev.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
plugin.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
plugin.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
proc_open.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
proc_open.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
request.c [core] respond 411 Length Required if request has Transfer-Encoding: chunked (fixes #631) 2016-03-26 12:58:33 +00:00
request.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
response.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
response.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
safe_memclear.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
safe_memclear.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
server.c [core] setrlimit max-fds <= rlim_max for non-root (fixes #2723) 2016-04-13 03:54:06 -04:00
server.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
settings.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
splaytree.c Fix header inclusion order, always include "config.h" before any system header 2009-10-11 14:31:42 +00:00
splaytree.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
stat_cache.c [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
stat_cache.h [core] open fd when appending file to cq (fixes #2655) 2016-04-18 04:27:08 -04:00
status_counter.c consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
status_counter.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
stream.c [stream] fstat() after open() to obtain file size 2016-04-01 17:38:29 +00:00
stream.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
sys-mmap.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
sys-socket.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00
test_base64.c [unittests] add test_buffer and test_base64 unit tests 2016-03-25 16:58:12 +00:00
test_buffer.c [unittests] add test_buffer and test_base64 unit tests 2016-03-25 16:58:12 +00:00
vector.c [core] add generic vector implementation 2016-03-19 15:27:36 +00:00
vector.h [core] add generic vector implementation 2016-03-19 15:27:36 +00:00
version.h consistent inclusion of config.h at top of files (fixes #2073) 2016-03-19 15:14:35 +00:00