Commit Graph

146 Commits

Author SHA1 Message Date
499a90a672 * Use apr_size_t instead of int to avoid an overflow
PR: 66034


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900307 13f79535-47bb-0310-9956-ffa450edef68
2022-04-27 06:43:11 +00:00
e2e1d77917 * Avoid an overflow on large inputs
PR: 66033


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900306 13f79535-47bb-0310-9956-ffa450edef68
2022-04-27 06:35:02 +00:00
63840edb44 ab: Allow for TLSv1.3 when the SSL library supports it.
When TLS1_3_VERSION is defined by the SSL library, bump the maximum TLS
protocol to that and use it for "-f ALL" or "-f TLSv1.3".

This mixes proposed patches from BZ 63594 and 64699.

BZ: 63594, 64699
Submitted by: abhilash <abhilash1232 gmail.com>
Submitted by: xiaolongx.jiang intel.com
Submitted & Reviewed by: ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900157 13f79535-47bb-0310-9956-ffa450edef68
2022-04-22 13:04:51 +00:00
533a895c1f *) mod_md: a possible NULL pointer deref was fixed in
the JSON code for persisting time periods (start+end).
     Fixes #282 on mod_md's github.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900145 13f79535-47bb-0310-9956-ffa450edef68
2022-04-22 08:45:31 +00:00
567a50205f core: Disable TCP_NOPUSH optimization on OSX. BZ 66019.
OSX supports TCP_NOPUSH but does not release the data retained (in TCP stack)
when the option is unset. It seems that unsetting it before the last write
does not help either so just disable the optimization for OSX in the core
output filter to avoid uncontrollable transmission delays.

* server/core_filters.c():
  Add the sock_nopush() helper that does nothing on OSX and platforms not
  supporting TCP_NOPUSH or TCP_CORK.

* server/core_filters.c(send_brigade_nonblocking):
  Use sock_nopush() instead of apr_socket_opt_set() for APR_TCP_NOPUSH option.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900100 13f79535-47bb-0310-9956-ffa450edef68
2022-04-21 10:02:29 +00:00
80795a9ae2 * Implement full auto status ("key: value" type status output).
Especially not only status summary counts for certificates and
   OCSP stapling but also lists. Auto status format is similar to
   what was used for mod_proxy_balancer.
   [Rainer Jung]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900039 13f79535-47bb-0310-9956-ffa450edef68
2022-04-19 14:11:39 +00:00
2d4d303201 *) mod_proxy: Add backend port to log messages to
ease identification of involved service.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900028 13f79535-47bb-0310-9956-ffa450edef68
2022-04-19 09:14:10 +00:00
6a0896d693 *) mod_heartmonitor: Set the documented default value
"10" for HeartbeatMaxServers instead of "0". With "0"
     no shared memory slotmem was initialized. [Rainer Jung]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900026 13f79535-47bb-0310-9956-ffa450edef68
2022-04-19 08:59:47 +00:00
716d664f7d * Add Changelog for r1899451, r1899454, r1899562, r1899564, r1899584
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899886 13f79535-47bb-0310-9956-ffa450edef68
2022-04-15 11:42:58 +00:00
5d3b2f1f0c *) mod_http2: use the new REQUEST buckets to forward request
on secondary connections. Use the now generic
     ap_process_connection() in h2 workers to process those.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899802 13f79535-47bb-0310-9956-ffa450edef68
2022-04-13 08:38:12 +00:00
fbb84e00fa Merge PR 311:
*) core/mod_http: use REQUEST meta buckets and a new HTTP/1.x specific
     input filter to separate the handling for HTTP requests from the
     handling of HTTP/1.x request parsing and checks.
     A new HTTP1_REQUEST_IN filter installs itself on http/1.1 connections
     before a request is being read. It generates either a REQUEST meta
     bucket on success or an ERROR bucket with the proposed response status.
     The core connection processing, relying on ap_read_request(), now expects
     a REQUEST or ERROR bucket from the input filters and is agnostic to
     specific HTTP versions and how they bring requests into the server.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899799 13f79535-47bb-0310-9956-ffa450edef68
2022-04-13 07:40:17 +00:00
d150ca6f4e Follow up to r1899777: CHANGES entry [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899786 13f79535-47bb-0310-9956-ffa450edef68
2022-04-12 17:43:20 +00:00
0296d7dfea *) core/mod_http: use RESPONSE meta buckets and a new HTTP/1.x specific
filter to send responses through the output filter chain.
     Specifically: the HTTP_HEADER output filter and ap_send_interim_response()
     create a RESPONSE bucket and no longer are concerned with HTTP/1.x
     serialization.
     A new HTTP1_RESPONSE_OUT transcode filter writes the proper HTTP/1.x
     bytes when dealing with a RESPONSE bucket. That filter installs itself
     on the pre_read_request hook when the connection has protocol 'http/1.1'.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899648 13f79535-47bb-0310-9956-ffa450edef68
2022-04-07 10:41:46 +00:00
a4ea0e7799 *) core: make ap_escape_quotes() work correctly on strings
with more than MAX_INT/2 characters, counting quotes double.
     Credit to <generalbugs@zippenhop.com> for finding this.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899609 13f79535-47bb-0310-9956-ffa450edef68
2022-04-06 09:17:42 +00:00
6bd9d17e08 *) core: adding a new hook and method to the API:
create_secondary_connection and ap_create_secondary_connection()
     to setup connections related to a "master" one, as used in
     the HTTP/2 protocol implementation.

  *) mod_http2: using the new API calls to get rid of knowledge
     about how the core handles conn_rec specifics.
     Improvements in pollset stream handling to use less sets.
     Using atomic read/writes instead of volatiles now.
     Keeping a reserve of "transit" pools and bucket_allocs for
     use on secondary connections to avoid repeated setup/teardowns.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899032 13f79535-47bb-0310-9956-ffa450edef68
2022-03-18 09:52:52 +00:00
df4d79d1a7 Sync CHANGES entries [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898697 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 14:54:52 +00:00
6418c66ab6 core: Make sure and check that LimitXMLRequestBody fits in system memory.
LimitXMLRequestBody can not exceed the size needed to ap_escape_html2() the
body without failing to allocate memory, so enforce this at load time based
on APR_SIZE_MAX, and make sure that ap_escape_html2() is within the bounds.

Document the limits for LimitXMLRequestBody in our docs.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898686 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 13:36:10 +00:00
0cb6384286 core: Simpler connection close logic if discarding the request body fails.
If ap_discard_request_body() sets AP_CONN_CLOSE by itself it simplifies and
allows to consolidate end_output_stream() and error_output_stream().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898683 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 13:19:37 +00:00
815cf05bb2 mod_rewrite: URI-to-filename rewrites to transparently handle proxy mappings.
Since mod_rewrite works on r->filename and mod_proxy's mapping=servlet|decoded
sets its "proxy:" URL there at pre_translate_name stage (i.e. before
mod_rewrite's translate_name hook), users have to match the full proxy URL in
their RewriteRules to handle proxy mappings, which is not very friendly nor
consistent with how proxy non-mapping requests have to be matched.

Let's use r->filename = r->uri in hook_uri2file() for pre_trans'ed reverse
proxy requests, and restore r->filename to its original value if the request
was finally DECLINED (like in hook_fixup).

But if a proxy mapping gets rewritten to a non-proxy request, clear any
proxy specific r->proxyreq or r->handler so that processing continues
accordingly.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898509 13f79535-47bb-0310-9956-ffa450edef68
2022-03-01 13:26:03 +00:00
338daf4719 *) mod_watchdog: use the child_stopping and child_stopped hooks
to shutdown workers before pool destruction releases global
     resources and libraries.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898370 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 11:56:01 +00:00
2e239ed8e6 * core/mpm: add hook 'child_stopped` that gets called when the MPM has
stopped all processing in a child process. This is when all running
    threads shall be stopped and joined.
    [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898369 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 11:53:53 +00:00
6137cd7b74 *) 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
2022-02-17 10:06:31 +00:00
d27a32da69 * 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
2022-02-16 12:35:36 +00:00
b90220157d *) 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
2022-02-10 10:59:08 +00:00
600072cf7c 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
2022-02-09 18:23:23 +00:00
4a6bf7f895 *) 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
2022-02-08 13:38:49 +00:00
5540d05c9f 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
2022-02-08 12:34:52 +00:00
cbde30f832 * 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
2022-02-08 12:18:45 +00:00
17f35eb66d Reinstate r1897458 accidentally reverted in r1897760.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897861 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 11:22:14 +00:00
fd79f533bf 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
2022-02-08 11:09:11 +00:00
7953689acc Sync CHANGES entries. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897858 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 11:04:49 +00:00
711bf3ee18 *) 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
2022-02-07 14:40:46 +00:00
b11e669f07 *) 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
2022-02-04 12:22:26 +00:00
c6960b3b4c * 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
2022-01-31 08:58:36 +00:00
df7e92eac8 * Fix typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897615 13f79535-47bb-0310-9956-ffa450edef68
2022-01-31 08:19:14 +00:00
e5d6b2a50e * CHANGES entry for r1897182
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897614 13f79535-47bb-0310-9956-ffa450edef68
2022-01-31 08:16:35 +00:00
88ffb0ecd3 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
2022-01-25 15:54:22 +00:00
4145dfbd86 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
2022-01-24 16:08:14 +00:00
af55830264 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
2022-01-20 20:03:04 +00:00
702712a43d Follow up to r1897240: CHANGES entry.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897242 13f79535-47bb-0310-9956-ffa450edef68
2022-01-20 11:37:16 +00:00
371f5669ca mpm_event: Fix a possible listener deadlock. PR 65769.
When the listener starts accepting more connections than the number of workers
already started (due to scheduling), the listening sockets gets disabled (per
AH03269) but nothing was re-enabling them before the end of the connections,
despite the creation of more idle/available workers in the meantime.
In the wost case there is no idle worker when the listener accepts the first
connection thus nothing to wake up the listener blocked in poll() with no
socket, hence a deadlock.

Fix this by waking up the listener when a worker becomes idle and this unblocks
connections_above_limit(). This is also worthwhile when all the workers are
started (fully initialized runtime) since the number of idle workers is a
condition for connections_above_limit() anyway so the sooner the listeners are
re-enabled the better (the other condition is the number of connections which
is unblocked appropriately by decrement_connection_count() already).

Also when a child exists with ps->quiescing == 1 and it's caught by
server_main_loop() before perform_idle_server_maintenance(), active_daemons was
not decrement as needed (including accross restarts), leading to an invalid
active_daemons accounting.

* server/mpm/event/event.c(should_enable_listensocks):
  New helper that returns whether listenning sockets can be poll()ed again.

* server/mpm/event/event.c(decrement_connection_count, listener_thread):
  Use should_enable_listensocks() where previously open-coded.

* server/mpm/event/event.c(worker_thread):
  Wake up the listener when is_idle => 1 and should_enable_listensocks().
  Have a single point of exit when workers_may_exit to make sure that the
  wake always occurs (even when exiting).

* server/mpm/event/event.c(server_main_loop):
  Decrement active_daemons not only when !ps->quiescing but also when
  ps->quiescing == 1, i.e. all the cases not handled by
  perform_idle_server_maintenance() already.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1896505 13f79535-47bb-0310-9956-ffa450edef68
2021-12-29 13:12:44 +00:00
f7067a9385 Add a change entry for r1896278
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1896279 13f79535-47bb-0310-9956-ffa450edef68
2021-12-22 14:36:29 +00:00
14ffd8c7b3 Sync changes-entries [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895953 13f79535-47bb-0310-9956-ffa450edef68
2021-12-14 15:24:32 +00:00
3ec0ffb9e1 http: Enforce that fully qualified uri-paths not to be forward-proxied
have an http(s) scheme, and that the ones to be forward proxied have a
      hostname, per HTTP specifications.

The early checks avoid failing the request later on and thus save cycles
for those invalid cases.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895921 13f79535-47bb-0310-9956-ffa450edef68
2021-12-13 18:55:18 +00:00
b8a58e6aa9 * Correctly sent a 100 Continue status code when sending an interim
response as result of an Expect: 100-Continue in the request and not the
  current status code of the request.

PR: 65725


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895719 13f79535-47bb-0310-9956-ffa450edef68
2021-12-09 08:38:30 +00:00
1598f7aebd *) mod_http2: fixed a bug in v2.0.0 that could lead to an infinite
loop when clients close connections prematurely.
     Enhanced the scoreboard status updates on h2 connections for
     mod_status. 'server-status' now gives a better idea what the
     connection is working on.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895614 13f79535-47bb-0310-9956-ffa450edef68
2021-12-06 10:34:27 +00:00
34da2e78b7 Sync CHANGES entries. [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895558 13f79535-47bb-0310-9956-ffa450edef68
2021-12-03 16:09:47 +00:00
85ae4b4d6a *) mod_tls: added mod_tls from abetterinternet, donated
by ISRG/Prossimo <https://github.com/abetterinternet/mod_tls>.
     - adds font-/backend TLS (v1.2/v1.3) via the Rust rustls crate
       and its rustls-ffi C binding <https://github.com/rustls/rustls-ffi>.
     - documentation at <https://github.com/abetterinternet/mod_tls>
       (adding to Apache's manual TBD)
     - build support for Apache httpd configure on *nix platforms,
       rustls is linked statically into mod_tls.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895432 13f79535-47bb-0310-9956-ffa450edef68
2021-11-30 16:29:20 +00:00
9974b5a0e6 * mod_http2: the new pollset implementation is disabled when
compiling with an APR version less than 1.6.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895349 13f79535-47bb-0310-9956-ffa450edef68
2021-11-26 09:29:07 +00:00
5338e45798 mod_proxy: SetEnv proxy-nohalfclose to disable half-close tunneling. PR 65662.
Some connect/wstunnel protocols might want half-close forwarding while some
might not, let's provide an r->subprocess_env opt-out.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895304 13f79535-47bb-0310-9956-ffa450edef68
2021-11-24 17:49:47 +00:00