0.12.1
·
130 commits
to develop
since this release
Bugfix
- Fix: the cache no longer truncates responses larger than
cache_max_each_size. With thecachefeature enabled, a cacheable response whose body exceededcache_max_each_size(default 65535 bytes) was truncated when delivered to the client, because the caching worker stopped forwarding the response body to the client as soon as the size limit was crossed. Depending on framing this surfaced either as a silently short body (chunked / unknown-length responses) or as a body/protocol error (whenContent-Lengthwas present). Such over-limit responses are now forwarded to the client in full and simply not cached; within-limit responses are cached as before. Relatedly, a response whose upstream body errors mid-stream now propagates that error to the client (failing as it did upstream) instead of the cache layer masking it as a clean, truncated end-of-stream. - Fix: ACME no longer panics with
static str is not valid path(acme = true). With ACME enabled, rpxy aborted with that message as soon as it contacted the ACME server. The cause was a transitive dependency used for ACME requests (async-web-client, pulled in viarustls-acme) that unconditionally constructedPathAndQuery::from_static("")on every outgoing request; this panics underhttp1.4.1, which started rejecting paths that do not begin with/(the empty string included). Thehttp1.3 -> 1.4 bump shipped in 0.12.0, so ACME was broken there. rpxy now buildsrustls-acmeagainst a patchedasync-web-client, restoring ACME certificate provisioning. Configurations that do not use ACME were unaffected. (GitHub Discussion #581 and Issue #583.)
Improvement
- Enable
TCP_NODELAYon downstream and upstream connections. rpxy now disables Nagle's algorithm on accepted client connections (both cleartext and TLS, set on the raw socket right after accept) and on the forwarder's upstream HTTP connector, matching common reverse-proxy practice. This avoids Nagle / delayed-ACK latency on the many small writes a proxy relays; the effect is most visible over connections with non-trivial round-trip time. Health-check probe connections and HTTP/3 (QUIC, UDP) are intentionally left unaffected. - Build the access-log record lazily to cut per-request allocations. The access-log record is now captured as cheap, reference-counted handles (request URI, method, headers) and formatted only when a log line is actually emitted, instead of eagerly building roughly eight owned strings on every request. This removes that per-request work when access logging is filtered out (for example, the stdout logger at
RUST_LOG=warnor higher; a configured file logger always emits the access log). The emitted log line is byte-for-byte unchanged, and the query-redaction guarantee ofredact_query_in_access_logis preserved: when redaction is enabled, query values are still masked at capture time so raw query strings are never retained in the record.
What's Changed
- fix(cache): forward oversized cacheable responses instead of truncating them by @junkurihara in #578
- perf(net): enable TCP_NODELAY on downstream and upstream connections by @junkurihara in #579
- chore(deps): bump chrono from 0.4.44 to 0.4.45 by @dependabot[bot] in #580
- perf(log): defer access-log string construction to Display by @junkurihara in #582
- 0.12.1 by @junkurihara in #584
Full Changelog: 0.12.0...0.12.1