Skip to content

Share HTTP accept properties - #13514

Merged
bneradt merged 1 commit into
apache:masterfrom
bneradt:share-http-accept-properties
Aug 27, 2026
Merged

Share HTTP accept properties#13514
bneradt merged 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

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.

@bryancall
bryancall requested a review from serrislew August 10, 2026 22:23
Comment thread src/proxy/http/Http1ClientSession.cc
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.

This patch introduces 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 at transaction start so overrides stay
isolated. Handoff paths keep their acceptors alive for the resulting
session.

Fixes: apache#3427
Copilot AI review requested due to automatic review settings August 25, 2026 20:58
@bneradt
bneradt force-pushed the share-http-accept-properties branch from e6a2ac7 to ae3c6f1 Compare August 25, 2026 20:58

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@serrislew
serrislew requested review from serrislew and a lite review from Copilot August 26, 2026 18:41

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

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

@bneradt
bneradt merged commit 670d195 into apache:master Aug 27, 2026
15 checks passed
@bneradt
bneradt deleted the share-http-accept-properties branch August 27, 2026 01:31
@github-project-automation github-project-automation Bot moved this to For v10.1.1 in ATS v10.1.x Sep 11, 2026
@github-project-automation github-project-automation Bot moved this to For v10.2.1 in ATS v10.2.x Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In progress
Status: For v10.1.1
Status: For v10.2.1

Development

Successfully merging this pull request may close these issues.

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

3 participants