mod_proxy_http: Avoid a double call to apr_table_get().
* modules/proxy/mod_proxy_http.c (ap_proxy_http_process_response):
Save a call to apr_table_get(r->headers_out, "Transfer-Encoding").
No functional change.
@@ -1279,9 +1279,14 @@ int ap_proxy_http_process_response(proxy_http_req_t *req)
save_table);
}
+ /*
+ * Save a possible Transfer-Encoding header as we need it later for
+ * ap_http_filter to know where to end.
+ */
+ te = apr_table_get(r->headers_out, "Transfer-Encoding");
+
/* can't have both Content-Length and Transfer-Encoding */
- if (apr_table_get(r->headers_out, "Transfer-Encoding")
- && apr_table_get(r->headers_out, "Content-Length")) {
+ if (te && apr_table_get(r->headers_out, "Content-Length")) {
/*
* 2616 section 4.4, point 3: "if both Transfer-Encoding
* and Content-Length are received, the latter MUST be
@@ -1299,12 +1304,6 @@ int ap_proxy_http_process_response(proxy_http_req_t *req)
backend->close = 1;
}
- /*
- * Save a possible Transfer-Encoding header as we need it later for
- * ap_http_filter to know where to end.
- */
- te = apr_table_get(r->headers_out, "Transfer-Encoding");
-
upgrade = apr_table_get(r->headers_out, "Upgrade");
if (proxy_status == HTTP_SWITCHING_PROTOCOLS) {
if (!upgrade || !req->upgrade || (strcasecmp(req->upgrade,
