This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new a92d8babb7 Preserve client port in transaction logs (#13379)
a92d8babb7 is described below

commit a92d8babb71c72e1e55f706c795a540be67c496b
Author: Brian Neradt <[email protected]>
AuthorDate: Mon Jul 20 15:23:54 2026 -0500

    Preserve client port in transaction logs (#13379)
    
    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.
---
 src/proxy/logging/TransactionLogData.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/proxy/logging/TransactionLogData.cc 
b/src/proxy/logging/TransactionLogData.cc
index fb2cf26b79..b226fc8349 100644
--- a/src/proxy/logging/TransactionLogData.cc
+++ b/src/proxy/logging/TransactionLogData.cc
@@ -423,10 +423,7 @@ uint16_t
 TransactionLogData::get_client_port() const
 {
   if (likely(m_http_sm != nullptr)) {
-    if (auto txn = m_http_sm->get_ua_txn(); txn) {
-      return txn->get_client_port();
-    }
-    return 0;
+    return m_http_sm->t_state.effective_client_addr.host_order_port();
   }
   return m_non_http_sm_data->m_client_port;
 }

Reply via email to