summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2020-07-23 16:03:24 +0200
committerYann Ylavic <ylavic@apache.org>2020-07-23 16:03:24 +0200
commitba08e0602958eb669c259f5833916a983cd8ea53 (patch)
tree3155baaac9f5a61cbd67c91cc4d6f09f62ad56df
parentmod_proxy: follow up to r1879401: call filters on tunnel POLLERR. (diff)
downloadapache2-ba08e0602958eb669c259f5833916a983cd8ea53.tar.xz
apache2-ba08e0602958eb669c259f5833916a983cd8ea53.zip
mod_proxy_http: follow up to r1879419.
Better ap_proxy_tunnel_run() error handling. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1880204 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/proxy/mod_proxy_http.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c
index 76caf2c06a..ca35308c1b 100644
--- a/modules/proxy/mod_proxy_http.c
+++ b/modules/proxy/mod_proxy_http.c
@@ -349,7 +349,7 @@ static void proxy_http_async_cb(void *baton)
proxy_http_async_cancel_cb,
req, req->idle_timeout);
}
- else if (status != OK) {
+ else if (ap_is_HTTP_ERROR(status)) {
proxy_http_async_cancel_cb(req);
}
else {
@@ -1757,6 +1757,7 @@ int ap_proxy_http_process_response(proxy_http_req_t *req)
return HTTP_INTERNAL_SERVER_ERROR;
}
+ r->status = HTTP_SWITCHING_PROTOCOLS;
req->proto = upgrade;
if (req->can_go_async) {
@@ -1770,11 +1771,9 @@ int ap_proxy_http_process_response(proxy_http_req_t *req)
/* Let proxy tunnel forward everything within this thread */
req->tunnel->timeout = req->idle_timeout;
status = ap_proxy_tunnel_run(req->tunnel);
- if (!ap_is_HTTP_ERROR(status)) {
- /* Update r->status for custom log */
- status = HTTP_SWITCHING_PROTOCOLS;
+ if (ap_is_HTTP_ERROR(status)) {
+ r->status = status;
}
- r->status = status;
/* We are done with both connections */
r->connection->keepalive = AP_CONN_CLOSE;