]> git.ipfire.org Git - thirdparty/apache/httpd.git/log
thirdparty/apache/httpd.git
3 years ago *) mod_http2: preserve the port number given in a HTTP/1.1
Stefan Eissing [Thu, 17 Feb 2022 10:06:31 +0000 (10:06 +0000)] 
  *) mod_http2: preserve the port number given in a HTTP/1.1
     request that was Upgraded to HTTP/2. Fixes PR65881.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898146 13f79535-47bb-0310-9956-ffa450edef68

3 years ago* Change the logic to choose the maximum of both timeouts (front end socket,
Ruediger Pluem [Wed, 16 Feb 2022 12:35:36 +0000 (12:35 +0000)] 
* Change the logic to choose the maximum of both timeouts (front end socket,
  backend socket) instead of the minimum as backend timeouts can be
  configured more selectively (per worker if needed) as front end timeouts
  and typically the backend timeouts reflect the application requirements
  better.

PR: 65886

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898127 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) test: capture and parse output from nghttp more reliably.
Stefan Eissing [Mon, 14 Feb 2022 13:52:55 +0000 (13:52 +0000)] 
  *) test: capture and parse output from nghttp more reliably.
     add repeat param to certain proxy tests.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898068 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc rebuild.
Lucien Gentis [Sat, 12 Feb 2022 16:54:35 +0000 (16:54 +0000)] 
fr doc rebuild.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898008 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc XML file update.
Lucien Gentis [Sat, 12 Feb 2022 16:53:25 +0000 (16:53 +0000)] 
fr doc XML file update.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898007 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc XML files updates.
Lucien Gentis [Sat, 12 Feb 2022 16:47:09 +0000 (16:47 +0000)] 
fr doc XML files updates.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898006 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFollow up to r1897940: APLOGNO()s.
Yann Ylavic [Thu, 10 Feb 2022 21:04:12 +0000 (21:04 +0000)] 
Follow up to r1897940: APLOGNO()s.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897948 13f79535-47bb-0310-9956-ffa450edef68

3 years agoAPLOGNOs for r1897940 [skip ci].
Yann Ylavic [Thu, 10 Feb 2022 21:03:32 +0000 (21:03 +0000)] 
APLOGNOs for r1897940 [skip ci].

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897947 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) mod_http2: :scheme pseudo-header values, not matching the
Stefan Eissing [Thu, 10 Feb 2022 10:59:08 +0000 (10:59 +0000)] 
  *) mod_http2: :scheme pseudo-header values, not matching the
     connection scheme, are forwarded via absolute uris to the
     http protocol processing to preserve semantics of the request.
     Checks on combinations of pseudo-headers values/absence
     have been added as described in RFC 7540.
     Fixes <https://github.com/icing/mod_h2/issues/230>.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897940 13f79535-47bb-0310-9956-ffa450edef68

3 years agoTwo more APLOGNOs for PR #294 [skip ci]
Yann Ylavic [Wed, 9 Feb 2022 23:28:20 +0000 (23:28 +0000)] 
Two more APLOGNOs for PR #294 [skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897922 13f79535-47bb-0310-9956-ffa450edef68

3 years agoab: Fix the detection for when the server performed a legitimate
Graham Leggett [Wed, 9 Feb 2022 18:23:23 +0000 (18:23 +0000)] 
ab: Fix the detection for when the server performed a legitimate
connection close as per RFC7230 6.3.1. We must check whedther the
connection was previously kept alive, and not whether the current
closed request is keepalive.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897912 13f79535-47bb-0310-9956-ffa450edef68

3 years agoReserve two APLOGNOs for PR #294 [skip ci]
Yann Ylavic [Wed, 9 Feb 2022 11:28:00 +0000 (11:28 +0000)] 
Reserve two APLOGNOs for PR #294 [skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897898 13f79535-47bb-0310-9956-ffa450edef68

3 years ago* Fix a typo
Ruediger Pluem [Wed, 9 Feb 2022 09:24:12 +0000 (09:24 +0000)] 
* Fix a typo

Submitted by: Jens Schleusener <Jens.Schleusener@fossies.org>

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897890 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFollow up to r1897872: New APLOGNO
Yann Ylavic [Wed, 9 Feb 2022 00:21:11 +0000 (00:21 +0000)] 
Follow up to r1897872: New APLOGNO

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897882 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFollow up to r1897872: Reserve APLOGNO [skip ci]
Yann Ylavic [Wed, 9 Feb 2022 00:20:41 +0000 (00:20 +0000)] 
Follow up to r1897872: Reserve APLOGNO [skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897881 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) mod_http2: when a h2 request carries a ':scheme' pseudoheader,
Stefan Eissing [Tue, 8 Feb 2022 13:38:49 +0000 (13:38 +0000)] 
  *) mod_http2: when a h2 request carries a ':scheme' pseudoheader,
    it gives a 400 response if the scheme does not match the
    connection. Fixes <https://github.com/icing/mod_h2/issues/230>.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897872 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_http2: Fix possible beam bucket double free from session destroy.
Yann Ylavic [Tue, 8 Feb 2022 13:07:32 +0000 (13:07 +0000)] 
mod_http2: Fix possible beam bucket double free from session destroy.

When the session pool is destroyed, so is the beam's pool so we don't
want to run the beam cleanup twice.

ASan is reporting something like this (APR_POOL_DEBUG):

=================================================================
==81201==ERROR: AddressSanitizer: heap-use-after-free on address 0x603000080ce8 at pc 0x7fdc78962cc9 bp 0x7fdc731ff4f0 sp 0x7fdc731ff4e8
READ of size 8 at 0x603000080ce8 thread T11
    #0 0x7fdc78962cc8 in recv_buffer_cleanup ~httpd/modules/http2/h2_bucket_beam.c:279
    #1 0x7fdc78962fdc in beam_cleanup ~httpd/modules/http2/h2_bucket_beam.c:306
    #2 0x7fdc7896300c in beam_pool_cleanup ~httpd/modules/http2/h2_bucket_beam.c:313
    #3 0x7fdc7c5a8239 in run_cleanups memory/unix/apr_pools.c:2689
    #4 0x7fdc7c5a50f9 in pool_clear_debug memory/unix/apr_pools.c:1867
    #5 0x7fdc7c5a562e in pool_destroy_debug memory/unix/apr_pools.c:1965
    #6 0x7fdc7c5a5179 in pool_clear_debug memory/unix/apr_pools.c:1880
    #7 0x7fdc7c5a562e in pool_destroy_debug memory/unix/apr_pools.c:1965
    #8 0x7fdc7c5a5179 in pool_clear_debug memory/unix/apr_pools.c:1880
    #9 0x7fdc7c5a562e in pool_destroy_debug memory/unix/apr_pools.c:1965
    #10 0x7fdc7c5a5179 in pool_clear_debug memory/unix/apr_pools.c:1880
    #11 0x7fdc7c5a562e in pool_destroy_debug memory/unix/apr_pools.c:1965
    #12 0x7fdc7c5a5827 in apr_pool_destroy_debug memory/unix/apr_pools.c:2014
    #13 0x7fdc789aeaa5 in h2_session_pre_close ~httpd/modules/http2/h2_session.c:1934
    #14 0x7fdc7896a20e in h2_c1_pre_close ~httpd/modules/http2/h2_c1.c:188
    #15 0x7fdc7896b538 in h2_c1_hook_pre_close ~httpd/modules/http2/h2_c1.c:308
    #16 0x5596139aeb28 in ap_run_pre_close_connection ~httpd/server/connection.c:45
    #17 0x5596139af353 in ap_prep_lingering_close ~httpd/server/connection.c:128
    #18 0x5596139af3f2 in ap_start_lingering_close ~httpd/server/connection.c:154
    #19 0x7fdc7835bdf0 in process_lingering_close ~httpd/server/mpm/event/event.c:1999
    #20 0x7fdc78359ccb in process_socket ~httpd/server/mpm/event/event.c:1540
    #21 0x7fdc783608d7 in worker_thread ~httpd/server/mpm/event/event.c:2756
    #22 0x7fdc7c5d3e57 in dummy_worker threadproc/unix/thread.c:153
    #23 0x7fdc7c441d7f in start_thread nptl/pthread_create.c:481
    #24 0x7fdc7c337bde in clone (/lib/x86_64-linux-gnu/libc.so.6+0xfcbde)

0x603000080ce8 is located 8 bytes inside of 32-byte region [0x603000080ce0,0x603000080d00)
freed by thread T11 here:
    #0 0x7fdc7c887f07 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:122
    #1 0x7fdc7c5a5420 in pool_clear_debug memory/unix/apr_pools.c:1906
    #2 0x7fdc7c5a562e in pool_destroy_debug memory/unix/apr_pools.c:1965
    #3 0x7fdc7c5a5179 in pool_clear_debug memory/unix/apr_pools.c:1880
    #4 0x7fdc7c5a562e in pool_destroy_debug memory/unix/apr_pools.c:1965
    #5 0x7fdc7c5a5827 in apr_pool_destroy_debug memory/unix/apr_pools.c:2014
    #6 0x7fdc789aeaa5 in h2_session_pre_close ~httpd/modules/http2/h2_session.c:1934
    #7 0x7fdc7896a20e in h2_c1_pre_close ~httpd/modules/http2/h2_c1.c:188
    #8 0x7fdc7896b538 in h2_c1_hook_pre_close ~httpd/modules/http2/h2_c1.c:308
    #9 0x5596139aeb28 in ap_run_pre_close_connection ~httpd/server/connection.c:45
    #10 0x5596139af353 in ap_prep_lingering_close ~httpd/server/connection.c:128
    #11 0x5596139af3f2 in ap_start_lingering_close ~httpd/server/connection.c:154
    #12 0x7fdc7835bdf0 in process_lingering_close ~httpd/server/mpm/event/event.c:1999
    #13 0x7fdc78359ccb in process_socket ~httpd/server/mpm/event/event.c:1540
    #14 0x7fdc783608d7 in worker_thread ~httpd/server/mpm/event/event.c:2756
    #15 0x7fdc7c5d3e57 in dummy_worker threadproc/unix/thread.c:153
    #16 0x7fdc7c441d7f in start_thread nptl/pthread_create.c:481

previously allocated by thread T11 here:
    #0 0x7fdc7c8882b8 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7fdc7c5a4d00 in pool_alloc memory/unix/apr_pools.c:1787
    #2 0x7fdc7c5a507a in apr_palloc_debug memory/unix/apr_pools.c:1828
    #3 0x7fdc7c4d8160 in apr_brigade_create buckets/apr_brigade.c:90
    #4 0x7fdc7c4d82d8 in apr_brigade_split_ex buckets/apr_brigade.c:107
    #5 0x7fdc78967f7c in h2_beam_receive ~httpd/modules/http2/h2_bucket_beam.c:729
    #6 0x7fdc789b65f0 in buffer_output_receive ~httpd/modules/http2/h2_stream.c:847
    #7 0x7fdc789bb655 in h2_stream_read_output ~httpd/modules/http2/h2_stream.c:1372
    #8 0x7fdc789aa155 in on_stream_output ~httpd/modules/http2/h2_session.c:1313
    #9 0x7fdc789956ba in mplx_pollset_poll ~httpd/modules/http2/h2_mplx.c:1299
    #10 0x7fdc7898deb8 in h2_mplx_c1_poll ~httpd/modules/http2/h2_mplx.c:532
    #11 0x7fdc789ae04b in h2_session_process ~httpd/modules/http2/h2_session.c:1863
    #12 0x7fdc78969b0f in h2_c1_run ~httpd/modules/http2/h2_c1.c:138
    #13 0x7fdc7896b302 in h2_c1_hook_process_connection ~httpd/modules/http2/h2_c1.c:286
    #14 0x5596139ae4b6 in ap_run_process_connection ~httpd/server/connection.c:43
    #15 0x7fdc78358d67 in process_socket ~httpd/server/mpm/event/event.c:1353
    #16 0x7fdc783608d7 in worker_thread ~httpd/server/mpm/event/event.c:2756
    #17 0x7fdc7c5d3e57 in dummy_worker threadproc/unix/thread.c:153
    #18 0x7fdc7c441d7f in start_thread nptl/pthread_create.c:481

Thread T11 created by T2 here:
    #0 0x7fdc7c7baa22 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cc:208
    #1 0x7fdc7c5d4534 in apr_thread_create threadproc/unix/thread.c:228
    #2 0x7fdc7836273d in start_threads ~httpd/server/mpm/event/event.c:3035
    #3 0x7fdc7c5d3e57 in dummy_worker threadproc/unix/thread.c:153
    #4 0x7fdc7c441d7f in start_thread nptl/pthread_create.c:481

Thread T2 created by T0 here:
    #0 0x7fdc7c7baa22 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cc:208
    #1 0x7fdc7c5d4534 in apr_thread_create threadproc/unix/thread.c:228
    #2 0x7fdc78363d9f in child_main ~httpd/server/mpm/event/event.c:3262
    #3 0x7fdc7836483b in make_child ~httpd/server/mpm/event/event.c:3421
    #4 0x7fdc78364b89 in startup_children ~httpd/server/mpm/event/event.c:3444
    #5 0x7fdc78368abc in event_run ~httpd/server/mpm/event/event.c:3932
    #6 0x5596139b6d18 in ap_run_mpm ~httpd/server/mpm_common.c:101
    #7 0x55961399098b in main ~httpd/server/main.c:880
    #8 0x7fdc7c2627ec in __libc_start_main ../csu/libc-start.c:332

SUMMARY: AddressSanitizer: heap-use-after-free ~httpd/modules/http2/h2_bucket_beam.c:279 in recv_buffer_cleanup
Shadow bytes around the buggy address:
  0x0c0680008140: fa fa 00 00 00 00 fa fa fd fd fd fa fa fa fd fd
  0x0c0680008150: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa
  0x0c0680008160: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd
  0x0c0680008170: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd
  0x0c0680008180: fd fd fa fa fd fd fd fd fa fa fd fd fd fa fa fa
=>0x0c0680008190: fd fd fd fa fa fa fd fd fd fa fa fa fd[fd]fd fd
  0x0c06800081a0: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd
  0x0c06800081b0: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa
  0x0c06800081c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c06800081d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c06800081e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==81201==ABORTING

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897868 13f79535-47bb-0310-9956-ffa450edef68

3 years agoab: Add an optional ramp delay when starting concurrent connections so
Graham Leggett [Tue, 8 Feb 2022 12:34:52 +0000 (12:34 +0000)] 
ab: Add an optional ramp delay when starting concurrent connections so
as to not trigger denial of service protection in the network. Report
levels of concurrency achieved in cases where the test completes before
full concurrency is achieved.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897866 13f79535-47bb-0310-9956-ffa450edef68

3 years ago * test) sync of mod_md test cases from github.
Stefan Eissing [Tue, 8 Feb 2022 12:19:07 +0000 (12:19 +0000)] 
  * test) sync of mod_md test cases from github.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897864 13f79535-47bb-0310-9956-ffa450edef68

3 years ago * mod_md) do not interfere with requests to /.well-known/acme-challenge/
Stefan Eissing [Tue, 8 Feb 2022 12:18:45 +0000 (12:18 +0000)] 
  * mod_md) do not interfere with requests to /.well-known/acme-challenge/
    resources if challenge type 'http-01' is not configured for a domain.
    Fixes <https://github.com/icing/mod_md/issues/279>.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897863 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFix CHANGES typo. [skip ci]
Yann Ylavic [Tue, 8 Feb 2022 12:14:09 +0000 (12:14 +0000)] 
Fix CHANGES typo. [skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897862 13f79535-47bb-0310-9956-ffa450edef68

3 years agoReinstate r1897458 accidentally reverted in r1897760.
Graham Leggett [Tue, 8 Feb 2022 11:22:14 +0000 (11:22 +0000)] 
Reinstate r1897458 accidentally reverted in r1897760.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897861 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFollow up to r1896253: CHANGES entry. [skip ci]
Yann Ylavic [Tue, 8 Feb 2022 11:09:11 +0000 (11:09 +0000)] 
Follow up to r1896253: CHANGES entry. [skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897859 13f79535-47bb-0310-9956-ffa450edef68

3 years agoSync CHANGES entries. [skip ci]
Yann Ylavic [Tue, 8 Feb 2022 11:04:49 +0000 (11:04 +0000)] 
Sync CHANGES entries. [skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897858 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) mod_md: the status description in MDomain's JSON, exposed in the
Stefan Eissing [Mon, 7 Feb 2022 14:40:46 +0000 (14:40 +0000)] 
  *) mod_md: the status description in MDomain's JSON, exposed in the
     md-status handler (if configure) did sometimes not carry the correct
     message when certificates needed renew.
     [Stefan Eissing]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897819 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) core/mod_ssl/mpm_event: reverting changes to nonblocing SSL handshakes
Stefan Eissing [Fri, 4 Feb 2022 12:22:26 +0000 (12:22 +0000)] 
  *) core/mod_ssl/mpm_event: reverting changes to nonblocing SSL handshakes
     to stabilize CI tests again. Previous revision of trunk has been copied
     to branches/trunk-ssl-handshake-unblocking to make those into a PR where
     changes can be discussed and tested separately.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897760 13f79535-47bb-0310-9956-ffa450edef68

3 years agodoc update [skip ci]
Stefan Eissing [Fri, 4 Feb 2022 09:53:40 +0000 (09:53 +0000)] 
doc update [skip ci]

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897754 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) mod_http2: remove mentioning of Cache Digest draft
Stefan Eissing [Fri, 4 Feb 2022 09:53:21 +0000 (09:53 +0000)] 
  *) mod_http2: remove mentioning of Cache Digest draft
     that has been redacted for some time.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897753 13f79535-47bb-0310-9956-ffa450edef68

3 years agocore: Follow up to r1897240 & r1897691: Syntax.
Yann Ylavic [Wed, 2 Feb 2022 10:21:03 +0000 (10:21 +0000)] 
core: Follow up to r1897240 & r1897691: Syntax.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897692 13f79535-47bb-0310-9956-ffa450edef68

3 years agocore: Follow up to r1897240: Provide/export ap_thread_current_create()
Yann Ylavic [Wed, 2 Feb 2022 10:18:41 +0000 (10:18 +0000)] 
core: Follow up to r1897240: Provide/export ap_thread_current_create()

For completness, and possibly to ease backport to 2.4.x for MPM winnt.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897691 13f79535-47bb-0310-9956-ffa450edef68

3 years agocore: Follow up to r1897240: Opt-out for AP_HAS_THREAD_LOCAL and/or pcre's usage.
Yann Ylavic [Wed, 2 Feb 2022 10:02:26 +0000 (10:02 +0000)] 
core: Follow up to r1897240: Opt-out for AP_HAS_THREAD_LOCAL and/or pcre's usage.

If the compiler's thread_local is not efficient enough on some platforms, or
not desired, have a way to disable its usage in httpd (at compile time).

Handle -DAP_NO_THREAD_LOCAL and/or -DAPREG_NO_THREAD_LOCAL as build opt-out for
thread_local usage in httpd gobally and/or in ap_regex only (respectively).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897689 13f79535-47bb-0310-9956-ffa450edef68

3 years agomain: Follow up to r1897240: Fix bad log copypasta.
Yann Ylavic [Wed, 2 Feb 2022 02:06:42 +0000 (02:06 +0000)] 
main: Follow up to r1897240: Fix bad log copypasta.

Don't stderr printf the "stat" and "failed" results from the previous
apr_app_initialize() call for an error in ap_thread_main_create().

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897680 13f79535-47bb-0310-9956-ffa450edef68

3 years agocheck BIO_new(3) return values
Giovanni Bechis [Tue, 1 Feb 2022 15:29:18 +0000 (15:29 +0000)] 
check BIO_new(3) return values

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897663 13f79535-47bb-0310-9956-ffa450edef68

3 years agocheck BIO_new(3) return values
Giovanni Bechis [Tue, 1 Feb 2022 15:00:20 +0000 (15:00 +0000)] 
check BIO_new(3) return values

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897662 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Follow up to r1897240: Fetch the ovector _after_ the match.
Yann Ylavic [Tue, 1 Feb 2022 10:51:30 +0000 (10:51 +0000)] 
ap_regex: Follow up to r1897240: Fetch the ovector _after_ the match.

Possibly(?) pcre2_match() can modifiy the given pcre2_match_data and invalidate
the old ovector, be safe and fetch it after.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897651 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) test cases
Stefan Eissing [Tue, 1 Feb 2022 10:40:30 +0000 (10:40 +0000)] 
  *) test cases
     - disabling test_h2_105_02 due to handshake timeouts no longer working
     - adjusting some log levels
     - ignoring new handshake error AHLOGNOs

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897650 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) test: adding some more patterns to gitignore
Stefan Eissing [Tue, 1 Feb 2022 10:08:06 +0000 (10:08 +0000)] 
  *) test: adding some more patterns to gitignore

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897647 13f79535-47bb-0310-9956-ffa450edef68

3 years ago* Stupid mine. Evgeny is a committer here
Ruediger Pluem [Mon, 31 Jan 2022 08:58:36 +0000 (08:58 +0000)] 
* Stupid mine. Evgeny is a committer here

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897619 13f79535-47bb-0310-9956-ffa450edef68

3 years ago* Fix typo
Ruediger Pluem [Mon, 31 Jan 2022 08:19:14 +0000 (08:19 +0000)] 
* Fix typo

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897615 13f79535-47bb-0310-9956-ffa450edef68

3 years ago* CHANGES entry for r1897182
Ruediger Pluem [Mon, 31 Jan 2022 08:16:35 +0000 (08:16 +0000)] 
* CHANGES entry for r1897182

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897614 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc rebuild.
Lucien Gentis [Sat, 29 Jan 2022 13:27:49 +0000 (13:27 +0000)] 
fr doc rebuild.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897581 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc XML file update.
Lucien Gentis [Sat, 29 Jan 2022 13:26:55 +0000 (13:26 +0000)] 
fr doc XML file update.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897580 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_cgi[d]: Close the connection after handling nph- scripts.
Yann Ylavic [Fri, 28 Jan 2022 12:32:25 +0000 (12:32 +0000)] 
mod_cgi[d]: Close the connection after handling nph- scripts.

The HTTP output filters chain is bypassed for nph- scripts (whatever this
means), so there is no way to know whether the connection is reusable after
sending the cgi response (opaque header + body).

Set r->connection->keepalive = AP_CONN_CLOSE unconditionally.

For instance test frameork's "nph-foldhdr.pl" script responds with HTTP/1.0
and no Content-Length so closing the connection is the only way to detect the
end of response for the peer.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897563 13f79535-47bb-0310-9956-ffa450edef68

3 years agompm_event: Use APR_POLLEXCL when available to prevent thundering hurd.
Yann Ylavic [Thu, 27 Jan 2022 15:06:55 +0000 (15:06 +0000)] 
mpm_event: Use APR_POLLEXCL when available to prevent thundering hurd.

If APR_POLLEXCL is available, use it to prevent the thundering
herd issue. The listening sockets are potentially polled by all
the children at the same time, when new connections arrive this
avoids all of them to be woken up while most would get EAGAIN
on accept().

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897551 13f79535-47bb-0310-9956-ffa450edef68

3 years agocore: Follow up to r1897460: Provide ap_thread_main_create().
Yann Ylavic [Thu, 27 Jan 2022 12:34:53 +0000 (12:34 +0000)] 
core: Follow up to r1897460: Provide ap_thread_main_create().

Replace ap_thread_current_create() by ap_thread_main_create() which is how
it's used by httpd. The former is now a local helper only to implement the
latter.

This allows to consolidate/factorize common code in the main() of httpd and
the unix MPMs.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897543 13f79535-47bb-0310-9956-ffa450edef68

3 years agocore: Follow up to r1897460: Implement and use ap_thread_current_after_fork().
Yann Ylavic [Tue, 25 Jan 2022 20:28:28 +0000 (20:28 +0000)] 
core: Follow up to r1897460: Implement and use ap_thread_current_after_fork().

thread_local variables are not (always?) reset on fork(), so we need a way
to set the current_thread to NULL in the child process.

Implement and use ap_thread_current_after_fork() for that.

* include/httpd.h:
  Define ap_thread_current_after_fork().

* server/util.c:
  Implement ap_thread_current_after_fork().

* server/mpm/event/event.c, server/mpm/prefork/prefork.c,
    server/mpm/worker/worker.c:
  Use ap_thread_current_after_fork().

* server/mpm/winnt/child.c:
  Windows processes are not fork()ed and each child runs the main(), so
  ap_thread_current_create() was already called there.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897472 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFollow up to r1897460: !APR_HAS_THREAD implies no ap_thread_* either.
Yann Ylavic [Tue, 25 Jan 2022 17:55:16 +0000 (17:55 +0000)] 
Follow up to r1897460: !APR_HAS_THREAD implies no ap_thread_* either.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897462 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFollow up to r1897460: APLOGNOs.
Yann Ylavic [Tue, 25 Jan 2022 17:41:42 +0000 (17:41 +0000)] 
Follow up to r1897460: APLOGNOs.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897461 13f79535-47bb-0310-9956-ffa450edef68

3 years agocore: Efficient ap_thread_current() when apr_thread_local() is missing.
Yann Ylavic [Tue, 25 Jan 2022 17:34:57 +0000 (17:34 +0000)] 
core: Efficient ap_thread_current() when apr_thread_local() is missing.

#define ap_thread_create, ap_thread_current_create and ap_thread_current to
their apr-1.8+ equivalent if available, or implement them using the compiler's
thread_local mechanism if available, or finally provide stubs otherwise.

#define AP_HAS_THREAD_LOCAL to 1 in the two former case or 0 otherwise, while
AP_THREAD_LOCAL is defined to the compiler's keyword iff AP_HAS_THREAD_LOCAL.

Replace all apr_thread_create() calls with ap_thread_create() so that httpd
threads can use ap_thread_current()'s pool data as Thread Local Storage.

Bump MMN minor.

* include/httpd.h():
  Define AP_HAS_THREAD_LOCAL, AP_THREAD_LOCAL (eventually), ap_thread_create(),
  ap_thread_current_create() and ap_thread_current().

* server/util.c:
  Implement ap_thread_create(), ap_thread_current_create() and
  ap_thread_current() when APR < 1.8.

* modules/core/mod_watchdog.c, modules/http2/h2_workers.c,
    modules/ssl/mod_ssl_ct.c:
  Use ap_thread_create() instead of apr_thread_create.

* server/main.c:
  Use AP_HAS_THREAD_LOCAL and ap_thread_current_create instead of APR's.

* server/util_pcre.c:
  Use AP_HAS_THREAD_LOCAL and ap_thread_current instead of APR's.

* server/mpm/event/event.c, server/mpm/worker/worker.c,
    server/mpm/prefork/prefork.c:
  Use ap_thread_create() instead of apr_thread_create.
  Create an apr_thread_t/ap_thread_current() for the main chaild thread usable
  at child_init().

* server/mpm/winnt/child.c:
  Use ap_thread_create() instead of CreateThread().
  Create an apr_thread_t/ap_thread_current() for the main chaild thread usable

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897460 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Follow up to r1897240: #if APR_HAS_THREAD_LOCAL, not #ifdef.
Yann Ylavic [Tue, 25 Jan 2022 16:41:48 +0000 (16:41 +0000)] 
ap_regex: Follow up to r1897240: #if APR_HAS_THREAD_LOCAL, not #ifdef.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897459 13f79535-47bb-0310-9956-ffa450edef68

3 years agoab: Respond appropriately to SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE.
Graham Leggett [Tue, 25 Jan 2022 15:54:22 +0000 (15:54 +0000)] 
ab: Respond appropriately to SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE.
Previously the correct event was polled for, but the response to the poll
would call write instead of read, and read instead of write. PR 55952

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897458 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFixes ambiguos example, as per https://bz.apache.org/bugzilla/show_bug.cgi?id=63714
Rich Bowen [Mon, 24 Jan 2022 16:34:06 +0000 (16:34 +0000)] 
Fixes ambiguos example, as per https://bz.apache.org/bugzilla/show_bug.cgi?id=63714

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897425 13f79535-47bb-0310-9956-ffa450edef68

3 years agoBegone, foul tabs.
Graham Leggett [Mon, 24 Jan 2022 16:20:07 +0000 (16:20 +0000)] 
Begone, foul tabs.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897424 13f79535-47bb-0310-9956-ffa450edef68

3 years agoevent: Add AP_MPM_CAN_AGAIN and AGAIN to signal to the MPM that
Graham Leggett [Mon, 24 Jan 2022 16:14:42 +0000 (16:14 +0000)] 
event: Add AP_MPM_CAN_AGAIN and AGAIN to signal to the MPM that
non blocking behaviour is requested.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897423 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_reqtimeout: Set socket timeout for AP_MODE_INIT.
Yann Ylavic [Mon, 24 Jan 2022 16:08:14 +0000 (16:08 +0000)] 
mod_reqtimeout: Set socket timeout for AP_MODE_INIT.

If the SSL handshake is initiated by ssl_hook_process_connection() in
AP_MODE_INIT mode, we still want to adapt the socket timeout according
to the time left for the handshake.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897422 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_ssl: Use AP_FILTER_ERROR to indicate when the SSL filter has
Graham Leggett [Mon, 24 Jan 2022 14:11:19 +0000 (14:11 +0000)] 
mod_ssl: Use AP_FILTER_ERROR to indicate when the SSL filter has
handled its own errors.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897418 13f79535-47bb-0310-9956-ffa450edef68

3 years agoRevert stray modification in r1897336.
Graham Leggett [Mon, 24 Jan 2022 11:20:55 +0000 (11:20 +0000)] 
Revert stray modification in r1897336.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897408 13f79535-47bb-0310-9956-ffa450edef68

3 years agoAdd missing log message tag.
Graham Leggett [Sun, 23 Jan 2022 21:16:58 +0000 (21:16 +0000)] 
Add missing log message tag.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897388 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_ssl: We no longer throw away handshake errors. Handle APR_EGENERAL
Graham Leggett [Sun, 23 Jan 2022 21:16:06 +0000 (21:16 +0000)] 
mod_ssl: We no longer throw away handshake errors. Handle APR_EGENERAL
which means that mod_ssl has passed an http error down the stack.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897387 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Follow up to r1897240: cleanup PCRE2 match data on exit.
Yann Ylavic [Sun, 23 Jan 2022 20:48:29 +0000 (20:48 +0000)] 
ap_regex: Follow up to r1897240: cleanup PCRE2 match data on exit.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897386 13f79535-47bb-0310-9956-ffa450edef68

3 years agoevent: Allow the MPM to explicitly handle CONN_SENSE_WANT_WRITE instead
Graham Leggett [Sun, 23 Jan 2022 20:41:05 +0000 (20:41 +0000)] 
event: Allow the MPM to explicitly handle CONN_SENSE_WANT_WRITE instead
of support being implicit. Pass the desired sense depending on the state,
no longer default to write.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897385 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_ssl: An edge case exists where SSL_read might return SSL_ERROR_WANT_READ
Graham Leggett [Sat, 22 Jan 2022 22:02:11 +0000 (22:02 +0000)] 
mod_ssl: An edge case exists where SSL_read might return SSL_ERROR_WANT_READ
even in blocking BIO cases. Set guards so that an async MPM is not accessed
at this point. There is no need to set non blocking, mod_ssl's BIO already
knows how to do this.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897356 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_ssl: Add the missing SSL_ERROR_WANT_WRITE case in the SSL_read. Make
Graham Leggett [Sat, 22 Jan 2022 20:05:21 +0000 (20:05 +0000)] 
mod_ssl: Add the missing SSL_ERROR_WANT_WRITE case in the SSL_read. Make
sure the sense is correctly specified in response to SSL_ERROR_WANT_READ
and SSL_ERROR_WANT_WRITE so we don't poll for the wrong case.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897353 13f79535-47bb-0310-9956-ffa450edef68

3 years agoUse OK status to match process_connection behaviour.
Graham Leggett [Sat, 22 Jan 2022 18:54:37 +0000 (18:54 +0000)] 
Use OK status to match process_connection behaviour.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897352 13f79535-47bb-0310-9956-ffa450edef68

3 years agoShutdown immediately on read timeout.
Graham Leggett [Sat, 22 Jan 2022 18:27:33 +0000 (18:27 +0000)] 
Shutdown immediately on read timeout.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897351 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc rebuild.
Lucien Gentis [Sat, 22 Jan 2022 13:44:26 +0000 (13:44 +0000)] 
fr doc rebuild.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897340 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc XML files updates.
Lucien Gentis [Sat, 22 Jan 2022 13:43:20 +0000 (13:43 +0000)] 
fr doc XML files updates.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897339 13f79535-47bb-0310-9956-ffa450edef68

3 years agoWhen failing, we need to explicitly set the connection state.
Graham Leggett [Sat, 22 Jan 2022 12:09:12 +0000 (12:09 +0000)] 
When failing, we need to explicitly set the connection state.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897336 13f79535-47bb-0310-9956-ffa450edef68

3 years agoAPR 1.3 is a requirement for building httpd 2.4 and above.
Christophe Jaillet [Sat, 22 Jan 2022 08:42:53 +0000 (08:42 +0000)] 
APR 1.3 is a requirement for building httpd 2.4 and above.

So this compatibility test can be removed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897329 13f79535-47bb-0310-9956-ffa450edef68

3 years agoAPR (and APR-util) 1.3 is a requirement for building httpd 2.4 and above.
Christophe Jaillet [Sat, 22 Jan 2022 07:47:25 +0000 (07:47 +0000)] 
APR (and APR-util) 1.3 is a requirement for building httpd 2.4 and above.

So these compatibility tests can be removed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897326 13f79535-47bb-0310-9956-ffa450edef68

3 years agoAPR (and APR-util) 1.3 is a requirement for building httpd 2.4 and above.
Christophe Jaillet [Sat, 22 Jan 2022 07:32:36 +0000 (07:32 +0000)] 
APR (and APR-util) 1.3 is a requirement for building httpd 2.4 and above.

So these compatibility tests can be removed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897325 13f79535-47bb-0310-9956-ffa450edef68

3 years agoLink to where to open a bug, as requested in
Rich Bowen [Fri, 21 Jan 2022 16:39:57 +0000 (16:39 +0000)] 
Link to where to open a bug, as requested in
https://bz.apache.org/bugzilla/show_bug.cgi?id=61218

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897302 13f79535-47bb-0310-9956-ffa450edef68

3 years agoRemoves link to long-gone website.
Rich Bowen [Fri, 21 Jan 2022 16:05:28 +0000 (16:05 +0000)] 
Removes link to long-gone website.
Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=65651

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897300 13f79535-47bb-0310-9956-ffa450edef68

3 years agoPatch from Vedran Miletić. Notes version when this is supported.
Rich Bowen [Fri, 21 Jan 2022 15:21:10 +0000 (15:21 +0000)] 
Patch from Vedran Miletić. Notes version when this is supported.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897297 13f79535-47bb-0310-9956-ffa450edef68

3 years agoevent: Add support for non blocking behaviour in the
Graham Leggett [Fri, 21 Jan 2022 00:09:24 +0000 (00:09 +0000)] 
event: Add support for non blocking behaviour in the
CONN_STATE_READ_REQUEST_LINE phase, in addition to the existing
CONN_STATE_WRITE_COMPLETION phase. Update mod_ssl to perform non blocking
TLS handshakes.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897281 13f79535-47bb-0310-9956-ffa450edef68

3 years agoRevert 1897156.
Graham Leggett [Thu, 20 Jan 2022 22:13:24 +0000 (22:13 +0000)] 
Revert 1897156.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897273 13f79535-47bb-0310-9956-ffa450edef68

3 years agoSEDERR_TMAMES and SEDERR_TMRMES are used only in sed1.c with 'eval->lnum' as an argument.
Christophe Jaillet [Thu, 20 Jan 2022 21:28:17 +0000 (21:28 +0000)] 
SEDERR_TMAMES and SEDERR_TMRMES are used only in sed1.c with 'eval->lnum' as an argument.

'eval' is of type 'struct sed_eval_s' and 'lnum' is an apr_int64_t.

So use APR_INT64_T_FMT format specifier to be more consistent.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897271 13f79535-47bb-0310-9956-ffa450edef68

3 years agoThe format specifier is APR_SIZE_T_FMT, so there is no point in trying to log -1...
Christophe Jaillet [Thu, 20 Jan 2022 21:22:04 +0000 (21:22 +0000)] 
The format specifier is APR_SIZE_T_FMT, so there is no point in trying to log -1 if apr_file_read() fails, because size_t is unsigned.

It is more straighforward to log the real value returned by apr_file_read() in such a case. The error code is also logged anyway.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897270 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_unixd: Make CoreDumpDirectory work for FreeBSD 11+. PR 65819.
Yann Ylavic [Thu, 20 Jan 2022 20:03:04 +0000 (20:03 +0000)] 
mod_unixd: Make CoreDumpDirectory work for FreeBSD 11+. PR 65819.

FreeBSD 11+ coredumping requires tracing enabled via procctl(PROC_TRACE_CTL).

Submitted by: David CARLIER <devnexen gmail.com>
Reviewed by: ylavic (by inspection)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897269 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Follow up to r1897240: cleanups.
Yann Ylavic [Thu, 20 Jan 2022 18:20:40 +0000 (18:20 +0000)] 
ap_regex: Follow up to r1897240: cleanups.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897263 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Follow up to r1897240: no ap_thread_current() yet.
Yann Ylavic [Thu, 20 Jan 2022 17:08:02 +0000 (17:08 +0000)] 
ap_regex: Follow up to r1897240: no ap_thread_current() yet.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897261 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Follow up to r1897240: runtime fallback to alloc/free.
Yann Ylavic [Thu, 20 Jan 2022 17:01:40 +0000 (17:01 +0000)] 
ap_regex: Follow up to r1897240: runtime fallback to alloc/free.

Even though APR_HAS_THREAD_LOCAL is compiled in, ap_regexec() might still be
called by non a apr_thread_t thread, let's fall back to alloc/free in this
case too.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897260 13f79535-47bb-0310-9956-ffa450edef68

3 years ago *) test:
Stefan Eissing [Thu, 20 Jan 2022 15:36:50 +0000 (15:36 +0000)] 
 *) test:
    - modules/http2: ignore some SSL library error logs when using openssl 3.x
    - modules/tls: right now, we seem unable to force curl to use TLSv1.3, adjust
      test case expectations accordingly. Use --tls-max to force v1.2 where needed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897257 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Follow up to r1897240: Fix issues spotted by Rüdiger (thanks!).
Yann Ylavic [Thu, 20 Jan 2022 13:15:36 +0000 (13:15 +0000)] 
ap_regex: Follow up to r1897240: Fix issues spotted by Rüdiger (thanks!).

#include "apr_thread_proc.h" is enough/needed by util_pcre.c and main.c.
Fix compilation (vector => ovector) for !HAVE_PCRE2 && APR_HAS_THREAD_LOCAL.
Check pcre2_match_data_create() return value for HAVE_PCRE2 && !APR_HAS_THREAD_LOCAL.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897250 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Follow up to r1897244: Fix pmatch overflow and returned value at limits.
Yann Ylavic [Thu, 20 Jan 2022 12:47:02 +0000 (12:47 +0000)] 
ap_regex: Follow up to r1897244: Fix pmatch overflow and returned value at limits.

Don't write to pmatch[nlimit:] when ncaps > nlimit, rc should not exceed nmatch
either as before r1897244.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897248 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: PCRE needs buffers sized against the number of captures only.
Yann Ylavic [Thu, 20 Jan 2022 12:16:58 +0000 (12:16 +0000)] 
ap_regex: PCRE needs buffers sized against the number of captures only.

No more (useless), no less (or PCRE will allocate a new buffer by itself to
satisfy the needs), so we should base our buffer size solely on the number
of captures in the regex (determined at compile time from the pattern).

The nmatch provided by the user is used to fill in pmatch only (up to that),
but "our" buffers are sized exactly as needed to avoid oversized allocations
or PCRE allocating by itself.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897244 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFollow up to r1897240: CHANGES entry.
Yann Ylavic [Thu, 20 Jan 2022 11:37:16 +0000 (11:37 +0000)] 
Follow up to r1897240: CHANGES entry.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897242 13f79535-47bb-0310-9956-ffa450edef68

3 years agoFollow up to r1897240: APR_HAS_THREAD_LOCAL wants #ifdef instead of #if.
Yann Ylavic [Thu, 20 Jan 2022 11:24:59 +0000 (11:24 +0000)] 
Follow up to r1897240: APR_HAS_THREAD_LOCAL wants #ifdef instead of #if.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897241 13f79535-47bb-0310-9956-ffa450edef68

3 years agoap_regex: Use Thread Local Storage (if efficient) to avoid allocations.
Yann Ylavic [Thu, 20 Jan 2022 11:09:34 +0000 (11:09 +0000)] 
ap_regex: Use Thread Local Storage (if efficient) to avoid allocations.

PCRE2 wants an opaque context by providing the API to allocate and free it, so
to minimize these calls we maintain one opaque context per thread (in Thread
Local Storage, TLS) grown as needed, and while at it we do the same for PCRE1
ints vectors. Note that this requires a fast TLS mechanism to be worth it,
which is the case of apr_thread_data_get/set() from/to apr_thread_current()
when APR_HAS_THREAD_LOCAL; otherwise we'll do the allocation and freeing for
each ap_regexec().

The small stack vector is used for PCRE1 && !APR_HAS_THREAD_LOCAL only now.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897240 13f79535-47bb-0310-9956-ffa450edef68

3 years agoTrigger ci.
Yann Ylavic [Wed, 19 Jan 2022 22:03:17 +0000 (22:03 +0000)] 
Trigger ci.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897218 13f79535-47bb-0310-9956-ffa450edef68

3 years agomod_dav: Follow up to r1897156: Fix warning.
Yann Ylavic [Tue, 18 Jan 2022 20:51:42 +0000 (20:51 +0000)] 
mod_dav: Follow up to r1897156: Fix warning.

In file included from mod_dav.c:51:
mod_dav.c: In function ‘uripath_is_canonical’:
mod_dav.c:774:38: error: passing argument 1 of ‘ap_strchr’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  774 |             dot_pos = strchr(dot_pos + 1, '.')) {
      |                              ~~~~~~~~^~~
/home/travis/build/apache/httpd/include/httpd.h:2469:34: note: in definition of macro ‘strchr’
 2469 | # define strchr(s, c)  ap_strchr(s,c)
      |                                  ^
/home/travis/build/apache/httpd/include/httpd.h:2457:36: note: expected ‘char *’ but argument is of type ‘const char *’
 2457 | AP_DECLARE(char *) ap_strchr(char *s, int c);
      |                              ~~~~~~^

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897183 13f79535-47bb-0310-9956-ffa450edef68

3 years ago* Allocate the dav_liveprop_elem structure only once in the lifetime of the
Ruediger Pluem [Tue, 18 Jan 2022 20:13:29 +0000 (20:13 +0000)] 
* Allocate the dav_liveprop_elem structure only once in the lifetime of the
  resource->pool and reuse it to avoid unnecessary huge memory allocations
  during collection walks.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897182 13f79535-47bb-0310-9956-ffa450edef68

3 years agocore: Allow an optional expression to be specified for an effective
Graham Leggett [Mon, 17 Jan 2022 16:10:51 +0000 (16:10 +0000)] 
core: Allow an optional expression to be specified for an effective
path in the DirectoryMatch and LocationMatch directives. This allows
modules like mod_dav to map URLs to URL spaces or to directories on
the filesystem.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897156 13f79535-47bb-0310-9956-ffa450edef68

3 years agobump autuconf min to 2.60
Eric Covener [Sun, 16 Jan 2022 23:29:01 +0000 (23:29 +0000)] 
bump autuconf min to 2.60

AC_CHECK_TARGET_TOOLS is new in "2.59b" but not baking that weird arg in.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897136 13f79535-47bb-0310-9956-ffa450edef68

3 years agoutil: Follow up to r1897101 and r1897105: Yet better ap_cstr_casecmp[n]().
Yann Ylavic [Sun, 16 Jan 2022 00:45:34 +0000 (00:45 +0000)] 
util: Follow up to r1897101 and r1897105: Yet better ap_cstr_casecmp[n]().

Now with a shorter epilogue.

Dump of assembler code for function ap_cstr_casecmp:
   0x0000000000049fd0 <+0>: xor    %edx,%edx
   0x0000000000049fd2 <+2>: lea    0x3d567(%rip),%r8        # 0x87540 <ucharmap>
   0x0000000000049fd9 <+9>: nopl   0x0(%rax)
   0x0000000000049fe0 <+16>: movzbl (%rsi,%rdx,1),%eax
   0x0000000000049fe4 <+20>: movzbl (%r8,%rax,1),%ecx
   0x0000000000049fe9 <+25>: movzbl (%rdi,%rdx,1),%eax
   0x0000000000049fed <+29>: add    $0x1,%rdx
   0x0000000000049ff1 <+33>: movzbl (%r8,%rax,1),%eax
   0x0000000000049ff6 <+38>: sub    %ecx,%eax
   0x0000000000049ff8 <+40>: jne    0x49ffe <ap_cstr_casecmp+46>
   0x0000000000049ffa <+42>: test   %ecx,%ecx
   0x0000000000049ffc <+44>: jne    0x49fe0 <ap_cstr_casecmp+16>
   0x0000000000049ffe <+46>: ret
End of assembler dump.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897106 13f79535-47bb-0310-9956-ffa450edef68

3 years agoutil: Follow up to r1897101: Yet better ap_cstr_casecmp[n]().
Yann Ylavic [Sun, 16 Jan 2022 00:07:45 +0000 (00:07 +0000)] 
util: Follow up to r1897101: Yet better ap_cstr_casecmp[n]().

This ones have a shorter prologue (-O2 still).

Dump of assembler code for function ap_cstr_casecmp:
   0x0000000000049fd0 <+0>: xor    %edx,%edx
   0x0000000000049fd2 <+2>: lea    0x3d567(%rip),%r8        # 0x87540 <ucharmap>
   0x0000000000049fd9 <+9>: nopl   0x0(%rax)
   0x0000000000049fe0 <+16>: movzbl (%rdi,%rdx,1),%eax
   0x0000000000049fe4 <+20>: movzbl (%rsi,%rdx,1),%ecx
   0x0000000000049fe8 <+24>: add    $0x1,%rdx
   0x0000000000049fec <+28>: movzbl (%r8,%rax,1),%eax
   0x0000000000049ff1 <+33>: movzbl (%r8,%rcx,1),%ecx
   0x0000000000049ff6 <+38>: cmp    %ecx,%eax
   0x0000000000049ff8 <+40>: jne    0x49ffe <ap_cstr_casecmp+46>
   0x0000000000049ffa <+42>: test   %eax,%eax
   0x0000000000049ffc <+44>: jne    0x49fe0 <ap_cstr_casecmp+16>
   0x0000000000049ffe <+46>: sub    %ecx,%eax
   0x000000000004a000 <+48>: ret
End of assembler dump.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897105 13f79535-47bb-0310-9956-ffa450edef68

3 years agoutil: Improve ap_cstr_casecmp() and ap_cstr_casecmpn() performances.
Yann Ylavic [Sat, 15 Jan 2022 22:41:05 +0000 (22:41 +0000)] 
util: Improve ap_cstr_casecmp() and ap_cstr_casecmpn() performances.

The new versions [1] compile to a shorter/faster assembly than the previous
ones [2], no functionnal change.

[1] ap_cstr_casecmp() after this commit:
Dump of assembler code for function ap_cstr_casecmp:
   0x0000000000049fc0 <+0>: movzbl (%rdi),%eax
   0x0000000000049fc3 <+3>: movzbl (%rsi),%edx
   0x0000000000049fc6 <+6>: lea    0x3d573(%rip),%r8        # 0x87540 <ucharmap>
   0x0000000000049fcd <+13>: movzbl (%r8,%rax,1),%eax
   0x0000000000049fd2 <+18>: movzbl (%r8,%rdx,1),%ecx
   0x0000000000049fd7 <+23>: cmp    %ecx,%eax
   0x0000000000049fd9 <+25>: jne    0x49ffe <ap_cstr_casecmp+62>
   0x0000000000049fdb <+27>: xor    %edx,%edx
   0x0000000000049fdd <+29>: jmp    0x49ffa <ap_cstr_casecmp+58>
   0x0000000000049fdf <+31>: nop
   0x0000000000049fe0 <+32>: add    $0x1,%rdx
   0x0000000000049fe4 <+36>: movzbl (%rdi,%rdx,1),%eax
   0x0000000000049fe8 <+40>: movzbl (%rsi,%rdx,1),%ecx
   0x0000000000049fec <+44>: movzbl (%r8,%rax,1),%eax
   0x0000000000049ff1 <+49>: movzbl (%r8,%rcx,1),%ecx
   0x0000000000049ff6 <+54>: cmp    %ecx,%eax
   0x0000000000049ff8 <+56>: jne    0x49ffe <ap_cstr_casecmp+62>
   0x0000000000049ffa <+58>: test   %eax,%eax
   0x0000000000049ffc <+60>: jne    0x49fe0 <ap_cstr_casecmp+32>
   0x0000000000049ffe <+62>: sub    %ecx,%eax
   0x000000000004a000 <+64>: ret
End of assembler dump.

[2] ap_cstr_casecmp() before this commit:
Dump of assembler code for function ap_cstr_casecmp:
   0x000000000004a000 <+0>: movzbl (%rdi),%eax
   0x000000000004a003 <+3>: movzbl (%rsi),%edx
   0x000000000004a006 <+6>: lea    0x3d533(%rip),%r8        # 0x87540 <ucharmap>
   0x000000000004a00d <+13>: mov    %rdi,%r9
   0x000000000004a010 <+16>: mov    %rax,%rcx
   0x000000000004a013 <+19>: movswl (%r8,%rdx,2),%edx
   0x000000000004a018 <+24>: movswl (%r8,%rax,2),%eax
   0x000000000004a01d <+29>: sub    %edx,%eax
   0x000000000004a01f <+31>: jne    0x4a052 <ap_cstr_casecmp+82>
   0x000000000004a021 <+33>: mov    $0x1,%edx
   0x000000000004a026 <+38>: test   %ecx,%ecx
   0x000000000004a028 <+40>: je     0x4a052 <ap_cstr_casecmp+82>
   0x000000000004a02a <+42>: nopw   0x0(%rax,%rax,1)
   0x000000000004a030 <+48>: movzbl (%r9,%rdx,1),%eax
   0x000000000004a035 <+53>: movzbl (%rsi,%rdx,1),%ecx
   0x000000000004a039 <+57>: add    $0x1,%rdx
   0x000000000004a03d <+61>: mov    %rax,%rdi
   0x000000000004a040 <+64>: movswl (%r8,%rcx,2),%ecx
   0x000000000004a045 <+69>: movswl (%r8,%rax,2),%eax
   0x000000000004a04a <+74>: sub    %ecx,%eax
   0x000000000004a04c <+76>: jne    0x4a052 <ap_cstr_casecmp+82>
   0x000000000004a04e <+78>: test   %edi,%edi
   0x000000000004a050 <+80>: jne    0x4a030 <ap_cstr_casecmp+48>
   0x000000000004a052 <+82>: ret
End of assembler dump.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897101 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc rebuild.
Lucien Gentis [Sat, 15 Jan 2022 16:31:40 +0000 (16:31 +0000)] 
fr doc rebuild.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897094 13f79535-47bb-0310-9956-ffa450edef68

3 years agofr doc XML files updates.
Lucien Gentis [Sat, 15 Jan 2022 16:30:24 +0000 (16:30 +0000)] 
fr doc XML files updates.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897093 13f79535-47bb-0310-9956-ffa450edef68

3 years agoAdds a mention of the handy mod_log_debug module.
Rich Bowen [Tue, 11 Jan 2022 15:25:04 +0000 (15:25 +0000)] 
Adds a mention of the handy mod_log_debug module.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1896911 13f79535-47bb-0310-9956-ffa450edef68