Mailing List Archive

svn commit: r1916783 - in /httpd/httpd/tags/2.4.55: ./ include/ modules/aaa/ modules/generators/ modules/http/ modules/http2/ modules/proxy/
Author: covener
Date: Wed Apr 3 12:19:33 2024
New Revision: 1916783

URL: http://svn.apache.org/viewvc?rev=1916783&view=rev
Log:
revert recent unintended activity on old tag

svn merge -r 1916775:1916771



Modified:
httpd/httpd/tags/2.4.55/ (props changed)
httpd/httpd/tags/2.4.55/include/util_script.h
httpd/httpd/tags/2.4.55/modules/aaa/mod_authnz_fcgi.c
httpd/httpd/tags/2.4.55/modules/generators/mod_cgi.c
httpd/httpd/tags/2.4.55/modules/generators/mod_cgid.c
httpd/httpd/tags/2.4.55/modules/http/http_filters.c
httpd/httpd/tags/2.4.55/modules/http2/h2_session.c
httpd/httpd/tags/2.4.55/modules/http2/h2_stream.c
httpd/httpd/tags/2.4.55/modules/http2/h2_stream.h
httpd/httpd/tags/2.4.55/modules/proxy/ajp_header.c
httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_fcgi.c
httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_scgi.c
httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_uwsgi.c

Propchange: httpd/httpd/tags/2.4.55/
------------------------------------------------------------------------------
Reverse-merged /httpd/httpd/trunk:r1916769-1916771

Modified: httpd/httpd/tags/2.4.55/include/util_script.h
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/include/util_script.h?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/include/util_script.h (original)
+++ httpd/httpd/tags/2.4.55/include/util_script.h Wed Apr 3 12:19:33 2024
@@ -225,8 +225,6 @@ AP_DECLARE(int) ap_scan_script_header_er
*/
AP_DECLARE(void) ap_args_to_table(request_rec *r, apr_table_t **table);

-#define AP_TRUST_CGILIKE_CL_ENVVAR "ap_trust_cgilike_cl"
-
#ifdef __cplusplus
}
#endif

Modified: httpd/httpd/tags/2.4.55/modules/aaa/mod_authnz_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/aaa/mod_authnz_fcgi.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/aaa/mod_authnz_fcgi.c (original)
+++ httpd/httpd/tags/2.4.55/modules/aaa/mod_authnz_fcgi.c Wed Apr 3 12:19:33 2024
@@ -571,14 +571,6 @@ static apr_status_t handle_response(cons
"parsing -> %d/%d",
fn, status, r->status);

- /* FCGI has its own body framing mechanism which we don't
- * match against any provided Content-Length, so let the
- * core determine C-L vs T-E based on what's actually sent.
- */
- if (!apr_table_get(r->subprocess_env, AP_TRUST_CGILIKE_CL_ENVVAR))
- apr_table_unset(r->headers_out, "Content-Length");
- apr_table_unset(r->headers_out, "Transfer-Encoding");
-
if (rspbuf) { /* caller wants to see response body,
* if any
*/

Modified: httpd/httpd/tags/2.4.55/modules/generators/mod_cgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/generators/mod_cgi.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/generators/mod_cgi.c (original)
+++ httpd/httpd/tags/2.4.55/modules/generators/mod_cgi.c Wed Apr 3 12:19:33 2024
@@ -935,18 +935,9 @@ static int cgi_handler(request_rec *r)
char sbuf[MAX_STRING_LEN];
int ret;

- ret = ap_scan_script_header_err_brigade_ex(r, bb, sbuf,
- APLOG_MODULE_INDEX);
-
- /* xCGI has its own body framing mechanism which we don't
- * match against any provided Content-Length, so let the
- * core determine C-L vs T-E based on what's actually sent.
- */
- if (!apr_table_get(r->subprocess_env, AP_TRUST_CGILIKE_CL_ENVVAR))
- apr_table_unset(r->headers_out, "Content-Length");
- apr_table_unset(r->headers_out, "Transfer-Encoding");
-
- if (ret != OK) {
+ if ((ret = ap_scan_script_header_err_brigade_ex(r, bb, sbuf,
+ APLOG_MODULE_INDEX)))
+ {
ret = log_script(r, conf, ret, dbuf, sbuf, bb, script_err);

/*

Modified: httpd/httpd/tags/2.4.55/modules/generators/mod_cgid.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/generators/mod_cgid.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/generators/mod_cgid.c (original)
+++ httpd/httpd/tags/2.4.55/modules/generators/mod_cgid.c Wed Apr 3 12:19:33 2024
@@ -1616,18 +1616,9 @@ static int cgid_handler(request_rec *r)
b = apr_bucket_eos_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);

- ret = ap_scan_script_header_err_brigade_ex(r, bb, sbuf,
- APLOG_MODULE_INDEX);
-
- /* xCGI has its own body framing mechanism which we don't
- * match against any provided Content-Length, so let the
- * core determine C-L vs T-E based on what's actually sent.
- */
- if (!apr_table_get(r->subprocess_env, AP_TRUST_CGILIKE_CL_ENVVAR))
- apr_table_unset(r->headers_out, "Content-Length");
- apr_table_unset(r->headers_out, "Transfer-Encoding");
-
- if (ret != OK) {
+ if ((ret = ap_scan_script_header_err_brigade_ex(r, bb, sbuf,
+ APLOG_MODULE_INDEX)))
+ {
ret = log_script(r, conf, ret, dbuf, sbuf, bb, NULL);

/*

Modified: httpd/httpd/tags/2.4.55/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/http/http_filters.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/http/http_filters.c (original)
+++ httpd/httpd/tags/2.4.55/modules/http/http_filters.c Wed Apr 3 12:19:33 2024
@@ -778,18 +778,6 @@ static APR_INLINE int check_headers(requ
struct check_header_ctx ctx;
core_server_config *conf =
ap_get_core_module_config(r->server->module_config);
- const char *val;
-
- if ((val = apr_table_get(r->headers_out, "Transfer-Encoding"))) {
- if (apr_table_get(r->headers_out, "Content-Length")) {
- apr_table_unset(r->headers_out, "Content-Length");
- r->connection->keepalive = AP_CONN_CLOSE;
- }
- if (!ap_is_chunked(r->pool, val)) {
- r->connection->keepalive = AP_CONN_CLOSE;
- return 0;
- }
- }

ctx.r = r;
ctx.strict = (conf->http_conformance != AP_HTTP_CONFORMANCE_UNSAFE);
@@ -1365,9 +1353,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
*/
apr_table_clear(r->headers_out);
apr_table_clear(r->err_headers_out);
- r->content_type = r->content_encoding = NULL;
- r->content_languages = NULL;
- r->clength = r->chunked = 0;
apr_brigade_cleanup(b);

/* Don't recall ap_die() if we come back here (from its own internal
@@ -1384,6 +1369,8 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
APR_BRIGADE_INSERT_TAIL(b, e);
e = apr_bucket_eos_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(b, e);
+ r->content_type = r->content_encoding = NULL;
+ r->content_languages = NULL;
ap_set_content_length(r, 0);
recursive_error = 1;
}
@@ -1410,7 +1397,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
if (!apr_is_empty_table(r->err_headers_out)) {
r->headers_out = apr_table_overlay(r->pool, r->err_headers_out,
r->headers_out);
- apr_table_clear(r->err_headers_out);
}

/*
@@ -1430,17 +1416,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
fixup_vary(r);
}

-
- /*
- * Control cachability for non-cacheable responses if not already set by
- * some other part of the server configuration.
- */
- if (r->no_cache && !apr_table_get(r->headers_out, "Expires")) {
- char *date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
- ap_recent_rfc822_date(date, r->request_time);
- apr_table_addn(r->headers_out, "Expires", date);
- }
-
/*
* Now remove any ETag response header field if earlier processing
* says so (such as a 'FileETag None' directive).
@@ -1453,7 +1428,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
basic_http_header_check(r, &protocol);
ap_set_keepalive(r);

- /* 204/304 responses don't have content related headers */
if (AP_STATUS_IS_HEADER_ONLY(r->status)) {
apr_table_unset(r->headers_out, "Transfer-Encoding");
apr_table_unset(r->headers_out, "Content-Length");
@@ -1496,6 +1470,16 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
apr_table_setn(r->headers_out, "Content-Language", field);
}

+ /*
+ * Control cachability for non-cacheable responses if not already set by
+ * some other part of the server configuration.
+ */
+ if (r->no_cache && !apr_table_get(r->headers_out, "Expires")) {
+ char *date = apr_palloc(r->pool, APR_RFC822_DATE_LEN);
+ ap_recent_rfc822_date(date, r->request_time);
+ apr_table_addn(r->headers_out, "Expires", date);
+ }
+
/* This is a hack, but I can't find anyway around it. The idea is that
* we don't want to send out 0 Content-Lengths if it is a head request.
* This happens when modules try to outsmart the server, and return

Modified: httpd/httpd/tags/2.4.55/modules/http2/h2_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/http2/h2_session.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/http2/h2_session.c (original)
+++ httpd/httpd/tags/2.4.55/modules/http2/h2_session.c Wed Apr 3 12:19:33 2024
@@ -319,13 +319,9 @@ static int on_header_cb(nghttp2_session

status = h2_stream_add_header(stream, (const char *)name, namelen,
(const char *)value, valuelen);
- if (status != APR_SUCCESS &&
- (!stream->rtmp ||
- stream->rtmp->http_status == H2_HTTP_STATUS_UNSET ||
- /* We accept a certain amount of failures in order to reply
- * with an informative HTTP error response like 413. But if the
- * client is too wrong, we fail the request a RESET of the stream */
- stream->request_headers_failed > 100)) {
+ if (status != APR_SUCCESS
+ && (!stream->rtmp
+ || stream->rtmp->http_status == H2_HTTP_STATUS_UNSET)) {
return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE;
}
return 0;

Modified: httpd/httpd/tags/2.4.55/modules/http2/h2_stream.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/http2/h2_stream.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/http2/h2_stream.c (original)
+++ httpd/httpd/tags/2.4.55/modules/http2/h2_stream.c Wed Apr 3 12:19:33 2024
@@ -759,7 +759,6 @@ apr_status_t h2_stream_add_header(h2_str

cleanup:
if (error) {
- ++stream->request_headers_failed;
set_error_response(stream, error);
return APR_EINVAL;
}

Modified: httpd/httpd/tags/2.4.55/modules/http2/h2_stream.h
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/http2/h2_stream.h?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/http2/h2_stream.h (original)
+++ httpd/httpd/tags/2.4.55/modules/http2/h2_stream.h Wed Apr 3 12:19:33 2024
@@ -76,7 +76,6 @@ struct h2_stream {
struct h2_request *rtmp; /* request being assembled */
apr_table_t *trailers_in; /* optional, incoming trailers */
int request_headers_added; /* number of request headers added */
- int request_headers_failed; /* number of request headers failed to add */

#if AP_HAS_RESPONSE_BUCKETS
ap_bucket_response *response; /* the final, non-interim response or NULL */

Modified: httpd/httpd/tags/2.4.55/modules/proxy/ajp_header.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/proxy/ajp_header.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/proxy/ajp_header.c (original)
+++ httpd/httpd/tags/2.4.55/modules/proxy/ajp_header.c Wed Apr 3 12:19:33 2024
@@ -17,8 +17,6 @@
#include "ajp_header.h"
#include "ajp.h"

-#include "util_script.h"
-
APLOG_USE_MODULE(proxy_ajp);

static const char *response_trans_headers[] = {
@@ -664,14 +662,6 @@ static apr_status_t ajp_unmarshal_respon
}
}

- /* AJP has its own body framing mechanism which we don't
- * match against any provided Content-Length, so let the
- * core determine C-L vs T-E based on what's actually sent.
- */
- if (!apr_table_get(r->subprocess_env, AP_TRUST_CGILIKE_CL_ENVVAR))
- apr_table_unset(r->headers_out, "Content-Length");
- apr_table_unset(r->headers_out, "Transfer-Encoding");
-
return APR_SUCCESS;
}


Modified: httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_fcgi.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_fcgi.c Wed Apr 3 12:19:33 2024
@@ -764,15 +764,6 @@ recv_again:

status = ap_scan_script_header_err_brigade_ex(r, ob,
NULL, APLOG_MODULE_INDEX);
-
- /* FCGI has its own body framing mechanism which we don't
- * match against any provided Content-Length, so let the
- * core determine C-L vs T-E based on what's actually sent.
- */
- if (!apr_table_get(r->subprocess_env, AP_TRUST_CGILIKE_CL_ENVVAR))
- apr_table_unset(r->headers_out, "Content-Length");
- apr_table_unset(r->headers_out, "Transfer-Encoding");
-
/* suck in all the rest */
if (status != OK) {
apr_bucket *tmp_b;

Modified: httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_scgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_scgi.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_scgi.c (original)
+++ httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_scgi.c Wed Apr 3 12:19:33 2024
@@ -388,14 +388,6 @@ static int pass_response(request_rec *r,
return status;
}

- /* SCGI has its own body framing mechanism which we don't
- * match against any provided Content-Length, so let the
- * core determine C-L vs T-E based on what's actually sent.
- */
- if (!apr_table_get(r->subprocess_env, AP_TRUST_CGILIKE_CL_ENVVAR))
- apr_table_unset(r->headers_out, "Content-Length");
- apr_table_unset(r->headers_out, "Transfer-Encoding");
-
conf = ap_get_module_config(r->per_dir_config, &proxy_scgi_module);
if (conf->sendfile && conf->sendfile != scgi_sendfile_off) {
short err = 1;

Modified: httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_uwsgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_uwsgi.c?rev=1916783&r1=1916782&r2=1916783&view=diff
==============================================================================
--- httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_uwsgi.c (original)
+++ httpd/httpd/tags/2.4.55/modules/proxy/mod_proxy_uwsgi.c Wed Apr 3 12:19:33 2024
@@ -364,12 +364,6 @@ static int uwsgi_response(request_rec *r
apr_table_add(r->headers_out, buffer, value);
}

- /* T-E wins over C-L */
- if (apr_table_get(r->headers_out, "Transfer-Encoding")) {
- apr_table_unset(r->headers_out, "Content-Length");
- backend->close = 1;
- }
-
if ((buf = apr_table_get(r->headers_out, "Content-Type"))) {
ap_set_content_type(r, apr_pstrdup(r->pool, buf));
}