diff options
Diffstat (limited to 'src/mod_proxy.c')
-rw-r--r-- | src/mod_proxy.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/mod_proxy.c b/src/mod_proxy.c index 33ac1d8..6a8b8b1 100644 --- a/src/mod_proxy.c +++ b/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; } |