Skip to content

Share HTTP accept properties - #13514

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:share-http-accept-properties
Open

Share HTTP accept properties#13514
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:share-http-accept-properties

Conversation

@bneradt

@bneradt bneradt commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Each HTTP protocol acceptor keeps a separate copy of proxy-port
properties, so adding or consuming one requires protocol-specific
plumbing and can leave newer protocols without configured defaults.

Introduce a common HTTP acceptor base that shares one immutable
property set per proxy port and retains the source HttpProxyPort.
Sessions track that acceptor, while transactions copy mutable outbound
settings when they start so per-transaction overrides remain isolated.

Fixes: #3427

Each HTTP protocol acceptor keeps a separate copy of proxy-port
properties, so adding or consuming one requires protocol-specific
plumbing and can leave newer protocols without configured defaults.

Introduce a common HTTP acceptor base that shares one immutable
property set per proxy port and retains the source HttpProxyPort.
Sessions track that acceptor, while transactions copy mutable outbound
settings when they start so per-transaction overrides remain isolated.

Fixes: apache#3427
Copilot AI lite review requested due to automatic review settings August 7, 2026 15:59
@bneradt bneradt added this to the 11.0.0 milestone Aug 7, 2026
@bneradt bneradt added the Cleanup label Aug 7, 2026
@bneradt bneradt self-assigned this Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors HTTP acceptor configuration so all protocol-specific acceptors (HTTP/1.1, HTTP/2, HTTP/3/QUIC) for a given proxy port share a single immutable HttpSessionAccept::Options instance, and sessions keep a pointer to the acceptor (retaining access to both the shared options and the originating HttpProxyPort). Transactions continue to get an isolated mutable copy of outbound-related settings when a transaction starts, preserving per-transaction override behavior.

Changes:

  • Introduces HttpSessionAcceptBase, which owns a shared, immutable Options handle and retains proxyPort, and updates protocol acceptors to derive from it.
  • Replaces per-session stored accept_options pointer with a stored acceptor pointer (HttpSessionAcceptBase const *) and updates call sites accordingly.
  • Updates transaction initialization to copy outbound options from the session’s acceptor, and adds/updates unit tests validating the new sharing/inheritance behavior.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/proxy/ProxyTransaction.cc Initializes upstream_outbound_options from the session acceptor (and refreshes on new_transaction).
src/proxy/http3/Http3SessionAccept.cc Converts HTTP/3 acceptor to the shared-base pattern and passes acceptor through to apps/sessions.
src/proxy/http3/Http3App.cc Stores acceptor pointer on the session instead of an options pointer.
src/proxy/http3/Http09App.cc Stores acceptor pointer on the session instead of an options pointer.
src/proxy/http2/Http2Stream.cc Removes per-stream copy from accept_options (now sourced via ProxyTransaction).
src/proxy/http2/Http2SessionAccept.cc Converts HTTP/2 acceptor to the shared-base pattern and sets session acceptor.
src/proxy/http/unit_tests/test_HttpUserAgent.cc Updates existing test to use acceptor and adds a test for shared acceptor property inheritance.
src/proxy/http/HttpSM.cc Switches host resolution preference lookup from accept_options to acceptor->options().
src/proxy/http/HttpSessionAccept.cc Switches session initialization to store acceptor and reads transport type from shared options.
src/proxy/http/HttpProxyServerMain.cc Builds a single shared Options instance per proxy port and supplies it to all protocol acceptors.
src/proxy/http/Http1ClientSession.cc Removes per-connection copy of accept options into the transaction (now handled in ProxyTransaction).
include/proxy/ProxySession.h Replaces accept_options with HttpSessionAcceptBase const *acceptor.
include/proxy/http3/Http3SessionAccept.h Updates HTTP/3 acceptor to inherit from HttpSessionAcceptBase and removes embedded options copy.
include/proxy/http3/Http3App.h Updates constructor to accept an acceptor pointer.
include/proxy/http3/Http09App.h Updates constructor to accept an acceptor pointer.
include/proxy/http2/Http2SessionAccept.h Updates HTTP/2 acceptor to inherit from HttpSessionAcceptBase and removes embedded options copy.
include/proxy/http/HttpSessionAccept.h Adds HttpSessionAcceptBase and updates HttpSessionAccept constructors to use shared immutable options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove property copies from NetAccept object to NetVC object - keep a pointer instead

2 participants