Joe Orton [Thu, 31 May 2018 15:10:26 +0000 (15:10 +0000)]
Merge r1769718, r1785943, r1786110, r1786119 from trunk:
add an <IfFile> config section like <IfDefine>
It allows a non httpd config file to be used as a marker directly in
httpd.conf without hiding logic in a script in front of apachectl
to do test -f and pass extra -D's.
This is something we've had in IBM's httpd distro for a little bit and
hadn't remembered to share. I've seen some questions/config files come
up in a few places lately that would benefit from this as an option.
Remove duplicate implementations of conditional section function. No
functional change.
* server/core.c (start_cond_section): Factor out from start_if*.
Adjust to use apr_strmemdup.
(test_ifmod_section, test_iffile_section, test_ifdefine_section):
Move container-specific tests into callbacks from start_if*.
(core_cmds): Adjust <IfFile, <IfDefine, <IfModule to use
start_cond_section with callbacks.
Add <IfDirective> and <IfSection>:
* server/core.c
(test_ifdirective_section, test_ifsection_section): New callbacks.
(core_cmds): Define new directives.
* include/http_config.h, server/config.c (ap_exists_directive):
New function.
* include/ap_mmn.h: Bump MMN minor for above.
* docs/manual/mod/core.xml: Add docs.
* server/core.c (start_cond_section): Comment & variable name fixes,
no functional change.
Jim Jagielski [Thu, 31 May 2018 13:24:04 +0000 (13:24 +0000)]
Merge r1828890, r1832500 from trunk:
mod_proxy_balancer: Add hot spare member type and corresponding flag (R). Hot spare members are
used as drop-in replacements for unusable workers in the same load balancer set. This differs
from hot standbys which are only used when all workers in a set are unusable. PR 61140.
mod_proxy_balancer: follow up to r1828890: indentation and 80 col.
Silent a smatch warning:
mod_auth_form.c:626 get_form_auth() warn: variable dereferenced before check 'sent_user' (see line 616)
Use 'memcpy' instead of 'strcpy' when the size of the string has already been computed.
Fix compilation failure :
unixd.c: In function ‘ap_unixd_mpm_set_signals’:
unixd.c:579:5: error: implicit declaration of function ‘apr_signal’; did you mean ‘strsignal’? [-Werror=implicit-function-declaration]
apr_signal(SIGPIPE, SIG_IGN);
^~~~~~~~~~
strsignal
Not sure where it comes from, maybe related to r1812301.
mod_substitute: add runtime traces. PR 61132.
In verify_ocsp_status in ssl_engine_ocsp.c, the log message, "OCSP response not successful: %d" should print the value of r instead of rc.
The value of rc will always be 0.
PR 61876 [sam <sam.eastman.4114 gmail.com>]
Success of 'SHGetMalloc()' should be tested with the SUCCEEDED macro.
/!\ This commit is _NOT COMPILE TESTED_. (I don't have a windows build environment available)
See PR 60086.
Axe some dead code.
See PR 60086.
Fix typo
Fix a potential un-intialized variable usage warning.
This can not be a runtime ixsue, because, in such a case, we would assert and abort before.
Jim Jagielski [Wed, 30 May 2018 19:13:36 +0000 (19:13 +0000)]
Merge r1830562 from trunk:
On the trunk:
mod_http2: restoring the v1.10.16 keepalive timeout behavioud of mod_http2 (to be verified).
ALSO: mod_http2: adding regular memory cleanup when transferring large response bodies. This
reduces memory footprint and avoids memory exhaustion when transferring large files
on 32-bit architectures. Fixes PR 62325.
Submitted by: icing
Reviewed by: icing, ylavic, jim
Yann Ylavic [Tue, 29 May 2018 21:27:15 +0000 (21:27 +0000)]
Merge r1829513 from trunk:
* modules/ssl/ssl_engine_init.c (ssl_init_Module): Don't enable SSL
for a vhost if SSLEnable is not used and no certs are configured,
even if the Listen protocol is "https". Restores behaviour to that
prior to r1809303 for configs which would now otherwise fail at
startup.
Yann Ylavic [Tue, 29 May 2018 21:19:30 +0000 (21:19 +0000)]
Merge r1703248, r1827366 from trunk:
core: Avoid a compiler warning when NO_LINGCLOSE is used (-Wunreachable-code).
Also, check c->aborted before apr_socket_shutdown() because it is set earlier,
and there is no point in calling shutdown() before close().
Yann Ylavic [Tue, 29 May 2018 21:16:29 +0000 (21:16 +0000)]
Merge r1826687, r1827166, r1828210, r1828232, r1828687 from trunk:
Instrument 'bbout'
mod_http2: use proper ARP defined for formatting apr_off_t
On the trunk:
mod_http2: on level trace2, log any unsuccessful HTTP/2 direct connection upgrade
with base64 encoding to unify its appearance in possible bug reports.
On the trunk:
* mod_http2: calculate unencrypted connection sniffing base64 only when log level is at required height. [Ruediger Pluem]
On the trunk:
mod_http2: accurate reporting of h2 data input/output per request via mod_logio. Fixes
an issue where output sizes where counted n-times on reused slave connections. See
gituhub issue: https://github.com/icing/mod_h2/issues/158
Yann Ylavic [Tue, 29 May 2018 21:06:49 +0000 (21:06 +0000)]
Merge r1822849, r1822858, r1822878, r1822879, r1822883, r1828485, r1828493 from trunk:
* When mod_http2 is loaded more then ThreadsPerChild backend connections can
be useful as mod_http2 has an additional thread pool on top of
ThreadsPerChild.
But leave the default with ThreadsPerChild.
* Add some some comment why we do not limit hmax any longer
mod_proxy: follow up to r1822849.
Get the help(er) of mod_http2 to determine how much connections should
be handled in the reslist by default (i.e. max_threads).
mod_proxy: follow up to r1822849 and r1822878.
Does r1822878's "static" APR_RETRIEVE_OPTIONAL_FN work if, say, mod_proxy is
builtin but mod_http2 isn't?
Not worth taking the risk here since it's not a fast path...
Note: if this is an issue, I'm afraid it applies elsewhere too.
Jim Jagielski [Thu, 26 Apr 2018 17:35:44 +0000 (17:35 +0000)]
Merge r1828920 from trunk:
PR62186: preserve %<m for ErrorDocument internal redirects
*) core: Preserve the original HTTP request method in the '%<m' LogFormat
when an path-based ErrorDocument is used. PR 62186.
[Micha Lenk <micha lenk.info>]
Submitted By: Micha Lenk
Committed By: covener
Submitted by: covener
Reviewed by: covener, jhriggs, jim
Fix the number of available load balancer scheduler algorithms and add a link to the corresponding module. (lbmethod_heartbeat was missing in the list)
(r1829613 in trunk + some formating (trailing space and alignment) to synch with trunk)
Jim Jagielski [Mon, 9 Apr 2018 15:39:10 +0000 (15:39 +0000)]
Merge r1826973 from trunk:
mod_md: Fix compilation with OpenSSL before version 1.0.2.
Symbol ASN1_TIME_diff is only available for 1.0.2+,
but luckily alternative code we can use is already
available, originally written for the LibreSSL case.
Submitted by: rjung
Reviewed by: rjung, ylavic, jim
Jim Jagielski [Mon, 9 Apr 2018 15:37:44 +0000 (15:37 +0000)]
Merge r1534895, r1534896, r1534914 from trunk:
rotatelogs: Use apr_psprintf() with %pm instead of a constant length buffer for
errors.
* support/rotatelogs.c
(post_rotate, doRotate): Switch to using apr_psprintf() with %pm.
Suggested by: rpluem
rotatelogs: Remove another use of a consant length buffer for errors.
* support/rotatelogs.c
(doRotate): Use apr_psprintf() and %pm. Move the destruction of the pool
after we're done with the error message so the error string stays allocated
long enough.
rotatelogs: Remove last constant length error buffer.
* support/rotatelogs.c
(ERRMSGSZ): Remove.
(rotate_status): Remove errbuff member.
(truncate_and_write_error): Accept the error message as an argument.
(doRotate): Shift the pool destruction slightly later and use it to generate
the error message to pass truncate_and_write_error().
(main): In case of write errors create a pool to generate the error message,
since the other pools available may never been freed. Adjust to pass
message directly to truncate_and_write_error().
Submitted by: breser
Reviewed by: rjung, ylavic, jim
Jim Jagielski [Mon, 9 Apr 2018 15:36:59 +0000 (15:36 +0000)]
Merge r1533810, r1533935, r1666417 from trunk:
Add an option to autocreate directories to rotatelogs.
* support/rotatelogs.c
(rotate_config): Remove const from szLogRoot since we'll be passing it to
apr_filepath_merge. Add create_path member.
(usage, dumpConfig): Update to reflect new -d option.
(doRotate): Add code that knows how to create the directories a log file
is going to go into.
(main): Add the -d option and canonicalize the incoming path with
apr_filepath_merge() so that the code in doRotate can work properly.
* docs/man/rotatelogs.8,
docs/manual/programs/rotatelogs.html.en: Update for -d option.
PR: 46669
Submitted by: Philippe Lantin <plantin cobaltgroup.com>
(which was actually a patch written by myself when I worked there)
Tweaked by: breser (ported to trunk and changed option from -p to -d)
Followup to r1533810: Put the rotatelogs docs in the right place.
* docs/man/rotatelogs.8,
docs/manual/programs/rotatelogs.html.en: Remove changes from r1533810.
* docs/manual/programs/rotatelogs.xml: Adjust docs for new -d option.
Choose "-D" instead of "-d" for the rotatelogs
option that creates the path to the log file.
I want to use "-d" for another directory related
option next where (I think) the "directory" "d"
makes more sense.
"-d" has not yet been backported, so changing
to "-D" is not a real compatibility issue.