Repository: trafficserver Updated Branches: refs/heads/master cb62dfd31 -> 2710ad047
TS-3222: Fix URL print to not put leading zeros in port. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2710ad04 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2710ad04 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2710ad04 Branch: refs/heads/master Commit: 2710ad047f1ccbd70cc338944f7ab6173097b5eb Parents: cb62dfd Author: Alan M. Carroll <[email protected]> Authored: Fri Dec 19 09:58:32 2014 -0600 Committer: Alan M. Carroll <[email protected]> Committed: Fri Dec 19 09:58:32 2014 -0600 ---------------------------------------------------------------------- CHANGES | 2 ++ proxy/hdrs/HTTP.cc | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2710ad04/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 62cdbf5..57e8e64 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ -*- coding: utf-8 -*- Changes with Apache Traffic Server 5.3.0 + *) [TS-3222] Fix port print to not have leading 0. + *) [TS-3088] Enable /etc/hosts resolution. *) [TS-3240] Add the `dstaddr` hash key to the balancer plugin. http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2710ad04/proxy/hdrs/HTTP.cc ---------------------------------------------------------------------- diff --git a/proxy/hdrs/HTTP.cc b/proxy/hdrs/HTTP.cc index aab1228..28d33d0 100644 --- a/proxy/hdrs/HTTP.cc +++ b/proxy/hdrs/HTTP.cc @@ -1563,7 +1563,6 @@ class UrlPrintHack { hdr->_test_and_fill_target_cache(); if (hdr->m_url_cached.valid()) { URLImpl* ui = hdr->m_url_cached.m_url_impl; - char port_buff[10]; m_hdr = hdr; // mark as potentially having modified values. @@ -1584,8 +1583,8 @@ class UrlPrintHack { if (0 == hdr->m_url_cached.port_get_raw() && hdr->m_port_in_header) { ink_assert(0 == ui->m_ptr_port); // shouldn't be set if not in URL. - ui->m_ptr_port = port_buff; - ui->m_len_port = sprintf(port_buff, "%.5d", hdr->m_port); + ui->m_ptr_port = m_port_buff; + ui->m_len_port = sprintf(m_port_buff, "%.5d", hdr->m_port); m_port_modified_p = true; } else { m_port_modified_p = false; @@ -1627,6 +1626,8 @@ class UrlPrintHack { bool m_port_modified_p; HTTPHdr* m_hdr; ///@} + /// Temporary buffer for port data. + char m_port_buff[6]; }; char*
