From: Yann Ylavic Date: Thu, 23 Jul 2020 14:03:24 +0000 (+0000) Subject: mod_proxy_http: follow up to r1879419. X-Git-Tag: 2.5.0-alpha2-ci-test-only~1257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba08e0602958eb669c259f5833916a983cd8ea53;p=thirdparty%2Fapache%2Fhttpd.git 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 --- diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 76caf2c06ae..ca35308c1bc 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;