Skip to content

Preserve client port in transaction logs#13379

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:preserve-client-port-logging
Open

Preserve client port in transaction logs#13379
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:preserve-client-port-logging

Conversation

@bneradt

@bneradt bneradt commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fixes behavior introduced via #13123


Client source ports could be logged as zero when the live inbound
connection was cleared before transaction log marshalling. This
obscured the effective client endpoint in access logs.

This reads the port from the effective client endpoint retained by
HttpSM, keeping it available after connection cleanup.

Client source ports could be logged as zero when the live inbound
connection was cleared before transaction log marshalling. This
obscured the effective client endpoint in access logs.

This reads the port from the effective client endpoint retained by
HttpSM, keeping it available after connection cleanup.
Copilot AI review requested due to automatic review settings July 13, 2026 21:42
@bneradt bneradt added this to the 11.0.0 milestone Jul 13, 2026
@bneradt bneradt self-assigned this Jul 13, 2026
@bneradt bneradt added Logging Bug PROXY Protocol easy_review No new logic, easy to review. labels Jul 13, 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 fixes a logging correctness issue where the client source port could be recorded as 0 if the live inbound connection was cleared before log marshalling. It does this by sourcing the port from the HttpSM-retained effective client endpoint (t_state.effective_client_addr), which is already used for client address logging.

Changes:

  • Update TransactionLogData::get_client_port() to return HttpSM::t_state.effective_client_addr.host_order_port() instead of querying the UA transaction’s live connection.
  • Keep the non-HttpSM logging path unchanged (still uses m_non_http_sm_data->m_client_port).

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

Labels

Projects

Status: No status
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants