mod_proxy: add ap_proxy_define_match_worker() and use it for ProxyPassMatch
and ProxyMatch section to distinguish between normal workers and workers
with regex substitutions in the name. Implement handling of such workers
in ap_proxy_get_worker(). PR 43513
mod_proxy: better check for worker->s->is_name_matchable
Return a match whenever we get to the end of the worker name, regardless
of whether there is URL left.
ProxyPassMatch had been using the default worker in trunk.
Follow up to r1609680: simpler/faster ap_proxy_strcmp_ematch().
No functional change.
Follow up to r1609680: further simplify/optimize ap_proxy_strcmp_ematch().
While at it, same treatment for its mother ap_strcmp_match().
make sure the $n of the regular expressions is not included the name of the worker.
for example, the example:
ProxyPassMatch "^(/.*\.gif)$" "http://backend.example.com:8000$1"
was giving:
AH00526: Syntax error on line nnn of bla/conf/httpd.conf:
ProxyPass Unable to parse URL: http://backend.example.com:8000$1
ap_proxy_define_match_worker: don't copy the url unnecessarily.
And save a few cycles, when the duplication is needed, by not copying
the ignored part.
ap_proxy_define_match_worker: disable connection reuse by default.
To avoid compat issues with dns/connection reuse now that a worker with
dollar substitution can be elected.
CHANGES entry for ap_proxy_define_match_worker().
Oups, axe spurious copypasta.
mod_proxy: unfail mixed ProxyPass/<Proxy> and ProxyPassMatch/<ProxyMatch>.
It is not a failure in current 2.4.x, so to ease backport and to avoid compat
breakage simply warn about the second directive being ignored.
This commit can be reverted in trunk if we want next versions to fail in this
case.
Joe Orton [Wed, 29 Jul 2020 14:16:14 +0000 (14:16 +0000)]
Merge r1879370, r1879757, r1879816, r1880404 from trunk:
Travis changes:
a) add job to check for empty APLOGNO() macros
b) don't install CPAN stuff if SKIP_TESTING is set
c) don't tail the error_log on test suite failure since it's almost
always irrelevant shutdown stuff and obscures the actual failures
d) use coloured grep output when showing segfaults to make them obvious in the
travis error_log output.
e.g. https://travis-ci.org/github/apache/httpd/jobs/703517978#L2537
Try removing the cached ~/perl5 to reset the broken worker
MPM test job.
Actually clear the cache for the worker MPM (missed in r1879757).
Eric Covener [Tue, 28 Jul 2020 12:37:48 +0000 (12:37 +0000)]
Merge r1878788 from trunk:
Try to fix once and for all, our "en" html file generation issues with different Java version.
Switch "en" doc files to UTF-8.
We should also change "en.xml" with:
<target-ext>.html.en.utf8</target-ext>
and run:
./build.sh bootstrap
./build.sh
to be consistent with other languages.
Before making a lot of noise, first give some time to see how this works in RL.
*) core: Drop an invalid Last-Modified header value coming
from a (F)CGI script instead of replacing it with Unix epoch.
Warn the users about Last-Modified header value replacements
and violations of the RFC.
trunk patch: http://svn.apache.org/r1748379
http://svn.apache.org/r1750747
http://svn.apache.org/r1750749
http://svn.apache.org/r1750953
http://svn.apache.org/r1751138
http://svn.apache.org/r1751139
http://svn.apache.org/r1751147
http://svn.apache.org/r1757818
http://svn.apache.org/r1879253
http://svn.apache.org/r1879348
2.4.x: trunk patches work, final view:
http://home.apache.org/~elukey/httpd-2.4.x-core-last_modified_tz_logging.patch
svn merge -c 1748379,1750747,1750749,1750953,1751138,1751139,1751139,1757818,1879253,r1879348 ^/httpd/httpd/trunk .
The code has been tested with a simple PHP script returning different Last-Modified
headers (GMT now, GMT now Europe/Paris, GMT tomorrow, GMT yesterday, PST now).
+1: elukey, jorton, jim
jorton: +1 though I'd say log at WARN or INFO for the APR_BAD_DATE case
rather than "silently" (at normal log-level) dropping the parsed header?
[also nit: wrapping a lone ap_log_rerror(,APLOG_X) call in
if (APLOGrX(..) is unnecessary/redundant]
Graham Leggett [Wed, 15 Jul 2020 14:59:43 +0000 (14:59 +0000)]
*) mod_http2: Fixes LimitRequestFields configuration handling to compensate for
browsers that send request headers as multiple ones to make best use of HTTP/2
compression.
Trunk version of patch:
http://svn.apache.org/r1879832
2.4.x:
svn merge -c 1879832 ^/httpd/httpd/trunk .
+1: icing, rpluem, minfrin
Graham Leggett [Wed, 15 Jul 2020 14:17:17 +0000 (14:17 +0000)]
*) mod_http2: Avoid segfaults in case of handling certain responses for
already aborted connections.
Trunk version of patch:
http://svn.apache.org/r1879544
http://svn.apache.org/r1879546
http://svn.apache.org/r1879547
Backport version for 2.4.x of patch:
https://github.com/apache/httpd/pull/132.diff
+1: rpluem, icing, minfrin
Graham Leggett [Wed, 8 Jul 2020 12:07:38 +0000 (12:07 +0000)]
*) mod_watchdog: Switch to simpler logic to avoid the thread cleanup running
before the thread has started, avoiding mutex operations with undefined
behaviour. [Christophe Jaillet]
Graham Leggett [Wed, 8 Jul 2020 11:53:48 +0000 (11:53 +0000)]
*) mod_http2: connection terminology renamed to master/secondary.
trunk patch: http://svn.apache.org/r1878926
http://svn.apache.org/r1879156
2.4.x patch: https://svn.apache.org/repos/asf/httpd/httpd/patches/2.4.x/h2-master-secondary.patch
+1: icing, ylavic, minfrin
ylavic: nitpicking, mixed "H2_secondary_IN" and "H2_secondary_OUT" case to
register the filters, but not for adding them. IIRC filters names
are case insentive so shouldn't matter, just popped at my eyes..
icing: updated patch and added r1879156 to fix the eye bleed.
jailletc36: CHANGES could also be looked at if it makes sense to update the terminology
also here
Graham Leggett [Wed, 8 Jul 2020 11:39:12 +0000 (11:39 +0000)]
*) core: Drop an invalid Last-Modified header value coming
from a (F)CGI script instead of replacing it with Unix epoch.
Warn the users about Last-Modified header value replacements
and violations of the RFC.
trunk patch: http://svn.apache.org/r1748379
http://svn.apache.org/r1750747
http://svn.apache.org/r1750749
http://svn.apache.org/r1750953
http://svn.apache.org/r1751138
http://svn.apache.org/r1751139
http://svn.apache.org/r1751147
http://svn.apache.org/r1757818
http://svn.apache.org/r1879253
http://svn.apache.org/r1879348
2.4.x: trunk patches work, final view:
http://home.apache.org/~elukey/httpd-2.4.x-core-last_modified_tz_logging.patch
svn merge -c 1748379,1750747,1750749,1750953,1751138,1751139,1751139,1757818,1879253,r1879348 ^/httpd/httpd/trunk .
The code has been tested with a simple PHP script returning different Last-Modified
headers (GMT now, GMT now Europe/Paris, GMT tomorrow, GMT yesterday, PST now).
+1: elukey, jorton, jim
jorton: +1 though I'd say log at WARN or INFO for the APR_BAD_DATE case
rather than "silently" (at normal log-level) dropping the parsed header?
[also nit: wrapping a lone ap_log_rerror(,APLOG_X) call in
if (APLOGrX(..) is unnecessary/redundant]
Joe Orton [Wed, 8 Jul 2020 07:41:44 +0000 (07:41 +0000)]
Clear cache for the worker job which appears to be in a bad state.
https://travis-ci.org/github/apache/httpd/jobs/705863962
[CTR under Travis exception]
Jim Jagielski [Tue, 7 Jul 2020 16:57:22 +0000 (16:57 +0000)]
Merge r1705539, r1877263, r1877291, r1879445 from trunk:
deduplicate the code handling the directory traversal for the
SSL[Proxy]CACertificatePath and SSLProxyMachineCertificatePath
directives
* modules/ssl/ssl_engine_init.c (ssl_add_version_components,
ssl_init_Module): Use temporary pool for variable lookup results
which don't need to live in pconf.
mod_ssl: Factor out code to read a BIO into a palloc'ed string:
* modules/ssl/ssl_util_ssl.c (modssl_bio_free_read): New function.
(asn1_string_convert): Use it here.
* modules/ssl/ssl_engine_vars.c: Use it throughout.
* modules/ssl/ssl_scache.c (ssl_scache_init): Use <16 character
cname argument for socache ->init() per the API constraint.
Jim Jagielski [Tue, 7 Jul 2020 16:56:32 +0000 (16:56 +0000)]
Merge r1864868 from trunk:
Fix a signed/unsigned comparison that can never match.
-1 is a valid length value (for socket, pipe and cgi buckets for example)
All path I've checked cast the -1 to (apr_size_t) in order for the comparison to work. So do it as well here.
This has been like that in trunk since r708144, about 11 years ago, so I assume that it is not really an issue.
Spotted by gcc 9.1 and -Wextra
Submitted by: jailletc36
Reviewed by: jailletc36, minfrin, jim
Graham Leggett [Sun, 5 Jul 2020 12:55:38 +0000 (12:55 +0000)]
*) Replace apr_psprintf with apr_pstrcat where the format strings only
contain %s to improve efficiency. Leave out error messages as they
are not on a crtical code path and error message become less readable
when taking out the format specifiers.
trunk patch: http://svn.apache.org/1862270
2.4.x patch: svn merge -c 1862270 ^/httpd/httpd/trunk .
+1: minfrin, rpluem, ylavic