diff options
author | Stefan Bühler <stbuehler@web.de> | 2009-11-07 22:00:10 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2009-11-07 22:00:10 +0000 |
commit | 2eaf42d0e51cafe06c30e9c2ff5f502bd4a7108d (patch) | |
tree | 9c924c7e7c0eafaf6e144423317aca2e5c85cd70 | |
parent | 781784664a1b9b5302254b5012044974b9de7b3b (diff) | |
download | lighttpd-git-2eaf42d0e51cafe06c30e9c2ff5f502bd4a7108d.tar.gz |
mod_fastcgi: Don't reconnect after connect() succeeded (fixes #2096)
- a reconnect would try to rebuild the outgoing queue,
which involves reusing the post body - but the first
try already removed it.
we could try reusing the queue, but otoh that really
isn't our problem. accept() it - handle it.
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2692 152afb58-edef-0310-8abb-c4023f1b3aa9
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/mod_fastcgi.c | 29 |
2 files changed, 7 insertions, 23 deletions
@@ -12,6 +12,7 @@ NEWS * reset tlsext_server_name in connection_reset - fixes random hostnames in the $HTTP["host"] conditional * export some SSL_CLIENT_* vars for client cert validation (fixes #1288, thx presbrey) * mod_fastcgi: fix mod_fastcgi packet parsing + * mod_fastcgi: Don't reconnect after connect() succeeded (fixes #2096) - 1.4.24 - 2009-10-25 * Add T_CONFIG_INT for bigger integers from the config (needed for #1966) diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c index 789a22af..269572f3 100644 --- a/src/mod_fastcgi.c +++ b/src/mod_fastcgi.c @@ -3081,34 +3081,17 @@ static handler_t fcgi_write_request(server *srv, handler_ctx *hctx) { if (ret < 0) { switch(errno) { + case EPIPE: case ENOTCONN: + case ECONNRESET: /* the connection got dropped after accept() - * - * this is most of the time a PHP which dies - * after PHP_FCGI_MAX_REQUESTS - * - */ - if (hctx->wb->bytes_out == 0 && - hctx->reconnects < 5) { - usleep(10000); /* take away the load of the webserver - * to give the php a chance to restart - */ - - fcgi_reconnect(srv, hctx); - - return HANDLER_WAIT_FOR_FD; - } - - /* not reconnected ... why - * - * far@#lighttpd report this for FreeBSD - * + * we don't care about that - if you accept() it, you have to handle it. */ - log_error_write(srv, __FILE__, __LINE__, "ssosd", - "[REPORT ME] connection was dropped after accept(). reconnect() denied:", + log_error_write(srv, __FILE__, __LINE__, "ssosb", + "connection was dropped after accept() (perhaps the fastcgi process died),", "write-offset:", hctx->wb->bytes_out, - "reconnect attempts:", hctx->reconnects); + "socket:", hctx->proc->connection_name); return HANDLER_ERROR; default: |