Fix mod_proxy dead host detection if connect() fails

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2704 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.26
Stefan Bühler 13 years ago
parent d601017b75
commit da3370e82e
  1. 29
      src/mod_proxy.c

@ -1047,11 +1047,32 @@ static handler_t proxy_handle_fdevent(void *s, void *ctx, int revents) {
*
*/
proxy_connection_close(srv, hctx);
joblist_append(srv, con);
if (hctx->host) {
hctx->host->is_disabled = 1;
hctx->host->disable_ts = srv->cur_ts;
log_error_write(srv, __FILE__, __LINE__, "sbdd", "proxy-server disabled:",
hctx->host->host,
hctx->host->port,
hctx->fd);
/* disable this server */
hctx->host->is_disabled = 1;
hctx->host->disable_ts = srv->cur_ts;
proxy_connection_close(srv, hctx);
/* reset the enviroment and restart the sub-request */
buffer_reset(con->physical.path);
con->mode = DIRECT;
con->http_status = 503;
con->mode = DIRECT;
joblist_append(srv, con);
} else {
proxy_connection_close(srv, hctx);
joblist_append(srv, con);
con->mode = DIRECT;
con->http_status = 503;
}
return HANDLER_FINISHED;
}

Loading…
Cancel
Save