Stefan Eissing [Thu, 29 Jun 2023 10:15:50 +0000 (10:15 +0000)]
mod_http2: when failing a request, make sure the request_rec fields
are populated (best effort) for the response generation since this
might access fields in there.
Respect a http_status already assigned during stream processing
for error generation.
Stefan Eissing [Wed, 28 Jun 2023 11:22:49 +0000 (11:22 +0000)]
*) mod_http2: new directive `H2ProxyRequests on|off` to enable handling
of HTTP/2 requests in a forward proxy configuration.
General forward proxying is enabled via `ProxyRequests`. If the
HTTP/2 protocol is also enabled for such a server/host, this new
directive is needed in addition.
Stefan Eissing [Wed, 21 Jun 2023 12:14:08 +0000 (12:14 +0000)]
*) mod_http2: adding checks for websocket support on platform and
server versions. Give error message accordingly when trying to
enable websockets in unsupported configurations.
Add test and code to check the, finally selected, server of
a request_rec for websocket support or 501 the request.
Stefan Eissing [Wed, 21 Jun 2023 09:49:13 +0000 (09:49 +0000)]
*) http_protocol: if there is a request and an error bucket in the input
brigade, always process the request bucket first. This gives the proper
context in which to evaluate the error bucket in.
Some error access r->method, for example, in their response body.
Yann Ylavic [Tue, 20 Jun 2023 15:53:11 +0000 (15:53 +0000)]
ab: More accurate stats for time limited (-t) runs.
When ab runs for a limited time, the number of requests configured (or the
default MAX_REQUESTS if not configured) may be lower than than the number
of requests actually/finally achieved, in which case the stats per request
is a window of the actual stats since we can't store all the results.
Rather than taking the last N requests of the run for the stats, do the mean
of all the requests reusing the same window slot, and print that.
If no number of requests is configured for a time limited run, it will stop
only at the end of the time (i.e. MAX_REQUESTS is ignored for the end of
test condition). So MAX_REQUESTS is renamed to TIMED_REQUESTS while at it.
Yann Ylavic [Tue, 20 Jun 2023 15:08:44 +0000 (15:08 +0000)]
ab: Fix crash with -W when exiting earlya on fatal error.
When multiple threads are failing (e.g. read/write timeout) it's not
thread-safe to simply/concurrently print the stats and exit. This can
result in garbage being printed or a crash.
Let's cleanly shutdown the threads and do the printing at a single point.
For the places where we want to fail but threads are not started yet we
can simply exit still, so to simplify the stats are not printed in an
atexit() handler.
Stefan Eissing [Tue, 20 Jun 2023 12:01:09 +0000 (12:01 +0000)]
*) mod_http2: added support for bootstrapping WebSockets via HTTP/2, as
described in RFC 8441. A new directive 'H2WebSockets on|off' has been
added. The feature is by default not enabled.
As also discussed in the manual, this feature should work for setups
using "ProxyPass backend-url upgrade=websocket" without further changes.
Special server modules for WebSockets will have to be adapted,
most likely, as the handling if IO events is different with HTTP/2.
HTTP/2 WebSockets are supported on platforms with native pipes. This
excludes Windows.
Stefan Eissing [Tue, 13 Jun 2023 14:36:43 +0000 (14:36 +0000)]
*) mod_http2: fixed a bug that could lead to a crash in main connection
output handling. This occured only when the last request on a HTTP/2
connection had been processed and the session decided to shut down.
This could lead to an attempt to send a final GOAWAY while the previous
write was still in progress. See PR 66646.
Stefan Eissing [Fri, 9 Jun 2023 15:02:21 +0000 (15:02 +0000)]
*) mod_http2: fixed a bug in flushing pending data on an already closed
connection that could lead to a busy loop, preventing the HTTP/2 session
to close down successfully. Fixed PR 66624.
Giovanni Bechis [Tue, 6 Jun 2023 22:02:37 +0000 (22:02 +0000)]
mod_ext_filter: check exit status of filter processes
Whenever a filter process returns a non-zero exit status, or is killed
by a signal, return a HTTP 500 error, and log the reason.
Ran top-level make update-log-msg-tags to update APLOGNO numbers.
Stefan Eissing [Thu, 1 Jun 2023 12:21:03 +0000 (12:21 +0000)]
*) core: add `final_resp_passed` flag to request_rec to allow
ap_die() to judge if it can send out a response. Bump mmn.
Enable test cases that check errors during response body to
appear as error on client side.
Stefan Eissing [Thu, 1 Jun 2023 10:38:53 +0000 (10:38 +0000)]
* mod_proxy_http2: fixed using the wrong "bucket_alloc" from the backend
connection when sending data on the frontend one. This caused crashes
or infinite loops in rare situations.
* mod_proxy_http2: fixed a bug in retry/response handling that could lead
to wrong status codes or HTTP messages send at the end of response bodies
exceeding the announced content-length.
* mod_proxy_http2: fix retry handling to not leak temporary errors.
On detecting that that an existing connection was shutdown by the other
side, a 503 response leaked even though the request was retried on a
fresh connection.
* mod_http2: fixed a bug that did cleanup of consumed and pending buckets in
the wrong order when a bucket_beam was destroyed.
Stefan Eissing [Mon, 22 May 2023 14:10:17 +0000 (14:10 +0000)]
*) mod_proxy_http2: fix retry handling to not leak temporary errors.
On detecting that that an existing connection was shutdown by the other
side, a 503 response leaked even though the request was retried on a
fresh connection.
When we are at flush_max_threshold and the next bucket is a metadata (i.e. next->length == 0), we still need to re-check for flush_max_threshold and associated optimisation (is_in_memory_bucket()) when we process this metadata bucket in the next iteration of the loop.
Graham Leggett [Fri, 19 May 2023 10:29:02 +0000 (10:29 +0000)]
mod_authnz_ldap.c: Make sure the authentication variables are set in
all cases where another module is the source of the authentication,
and that authenticated user is looked up in LDAP.
Stefan Eissing [Fri, 12 May 2023 11:28:59 +0000 (11:28 +0000)]
*) mod_http2: v2.0.15 with the following fixes and improvements
- New directive 'H2EarlyHint name value' to add headers to a response,
picked up already when a "103 Early Hints" response is sent. 'name' and
'value' must comply to the HTTP field restrictions.
This directive can be repeated several times and header fields of the
same names add. Sending a 'Link' header with 'preload' relation will
also cause a HTTP/2 PUSH if enabled and supported by the client.
- Fixed an issue where requests were not logged and accounted in a timely
fashion when the connection returns to "keepalive" handling, e.g. when
the request served was the last outstanding one.
This led to late appearance in access logs with wrong duration times
reported.
- Accurately report the bytes sent for a request in the '%O' Log format.
This addresses #203, a long outstanding issue where mod_h2 has reported
numbers over-eagerly from internal buffering and not what has actually
been placed on the connection.
The numbers are now the same with and without H2CopyFiles enabled.
Stefan Eissing [Tue, 2 May 2023 08:36:02 +0000 (08:36 +0000)]
*) mod_tls: updating to rustls-ffi version 0.9.2 or higher.
Checking in configure for proper version installed. Code
fixes for changed clienthello member name.
* In the reverse proxy case when we only want to keep encoded slashes untouched
we can have decoded '%''s in the URI that got sent to us in the original URL
as %25. Don't error out in this case but just fall through and have them
encoded to %25 when forwarding to the backend.
* If we fail to connect to all looked up IP's from the worker lookup cache it
might be caused by a change on DNS side. Try another DNS lookup in this case
and in case this causes a successful connection trigger a refresh of the
worker lookup cache.
mod_status: Remove duplicate keys "BusyWorkers" and "IdleWorkers".
Resolve inconsistency between the previous two occurrences by
counting workers in state SERVER_GRACEFUL no longer as busy,
but instead in a new counter "GracefulWorkers" (or on HTML
view as "workers gracefully restarting"). Also add the graceful
counter as a new column to the existing HTML per process table
for async MPMs.
PR 63300