mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
* revert r355823 and r355837
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@355853 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -758,20 +758,6 @@ static int proxy_handler(request_rec *r)
|
|||||||
worker->s->status |= PROXY_WORKER_IN_ERROR;
|
worker->s->status |= PROXY_WORKER_IN_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (access_status == PROXY_BACKEND_BROKEN) {
|
|
||||||
/*
|
|
||||||
* If the backend broke after the headers had been sent do not
|
|
||||||
* try another worker, but leave. Do not mark the worker as
|
|
||||||
* unsuable as this problem may not reoccur on the next request.
|
|
||||||
*
|
|
||||||
* TODO: Currently we abort the connection and notify all parties
|
|
||||||
* on the upstream that something went wrong by setting c->aborted
|
|
||||||
* to 1. This idea is currently vetoed and should be replaced with
|
|
||||||
* other methods
|
|
||||||
*/
|
|
||||||
r->connection->aborted = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
/* Unrecoverable error.
|
/* Unrecoverable error.
|
||||||
* Return the origin status code to the client.
|
* Return the origin status code to the client.
|
||||||
|
@@ -238,12 +238,6 @@ struct proxy_conn_pool {
|
|||||||
proxy_conn_rec *conn; /* Single connection for prefork mpm's */
|
proxy_conn_rec *conn; /* Single connection for prefork mpm's */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* Return code that scheme handlers should return if the backend connection
|
|
||||||
* broke after they have sent the headers
|
|
||||||
*/
|
|
||||||
#define PROXY_BACKEND_BROKEN -10
|
|
||||||
|
|
||||||
/* woker status flags */
|
/* woker status flags */
|
||||||
#define PROXY_WORKER_INITIALIZED 0x0001
|
#define PROXY_WORKER_INITIALIZED 0x0001
|
||||||
#define PROXY_WORKER_IGNORE_ERRORS 0x0002
|
#define PROXY_WORKER_IGNORE_ERRORS 0x0002
|
||||||
|
@@ -138,7 +138,6 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
|
|||||||
int havebody = 1;
|
int havebody = 1;
|
||||||
int isok = 1;
|
int isok = 1;
|
||||||
apr_off_t bb_len;
|
apr_off_t bb_len;
|
||||||
int data_sent = 0;
|
|
||||||
#ifdef FLUSHING_BANDAID
|
#ifdef FLUSHING_BANDAID
|
||||||
apr_int32_t conn_poll_fd;
|
apr_int32_t conn_poll_fd;
|
||||||
apr_pollfd_t *conn_poll;
|
apr_pollfd_t *conn_poll;
|
||||||
@@ -349,8 +348,6 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
|
|||||||
"proxy: error processing body");
|
"proxy: error processing body");
|
||||||
isok = 0;
|
isok = 0;
|
||||||
}
|
}
|
||||||
/* memorize that we sent data */
|
|
||||||
data_sent = 1;
|
|
||||||
apr_brigade_cleanup(output_brigade);
|
apr_brigade_cleanup(output_brigade);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -366,8 +363,6 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
|
|||||||
"proxy: error processing body");
|
"proxy: error processing body");
|
||||||
isok = 0;
|
isok = 0;
|
||||||
}
|
}
|
||||||
/* memorize that we sent data */
|
|
||||||
data_sent = 1;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
isok = 0;
|
isok = 0;
|
||||||
@@ -414,15 +409,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
|
|||||||
"proxy: send body failed to %pI (%s)",
|
"proxy: send body failed to %pI (%s)",
|
||||||
conn->worker->cp->addr,
|
conn->worker->cp->addr,
|
||||||
conn->worker->hostname);
|
conn->worker->hostname);
|
||||||
/*
|
return HTTP_SERVICE_UNAVAILABLE;
|
||||||
* If we have sent data (and thus the headers) we must let the
|
|
||||||
* others know.
|
|
||||||
*/
|
|
||||||
if (data_sent) {
|
|
||||||
return PROXY_BACKEND_BROKEN;
|
|
||||||
} else {
|
|
||||||
return HTTP_SERVICE_UNAVAILABLE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Nice we have answer to send to the client */
|
/* Nice we have answer to send to the client */
|
||||||
|
@@ -1199,7 +1199,6 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
|
|||||||
* are being read. */
|
* are being read. */
|
||||||
int pread_len = 0;
|
int pread_len = 0;
|
||||||
apr_table_t *save_table;
|
apr_table_t *save_table;
|
||||||
int backend_broken = 0;
|
|
||||||
|
|
||||||
bb = apr_brigade_create(p, c->bucket_alloc);
|
bb = apr_brigade_create(p, c->bucket_alloc);
|
||||||
|
|
||||||
@@ -1487,7 +1486,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
|
|||||||
*/
|
*/
|
||||||
ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c,
|
ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c,
|
||||||
"proxy: error reading response");
|
"proxy: error reading response");
|
||||||
backend_broken = 1;
|
c->aborted = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* next time try a non-blocking read */
|
/* next time try a non-blocking read */
|
||||||
@@ -1553,9 +1552,9 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
|
|||||||
}
|
}
|
||||||
} while (interim_response);
|
} while (interim_response);
|
||||||
|
|
||||||
/* Signal back that the backend broke after we sent the headers. */
|
/* If our connection with the client is to be aborted, return DONE. */
|
||||||
if (backend_broken) {
|
if (c->aborted) {
|
||||||
return PROXY_BACKEND_BROKEN;
|
return DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conf->error_override) {
|
if (conf->error_override) {
|
||||||
|
Reference in New Issue
Block a user