This is an automated email from the ASF dual-hosted git repository.
bcall 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 646b2d9 Fixes unmatched port when looking up HostDB
646b2d9 is described below
commit 646b2d9802202dee850f52a177bb6f6ef870c65b
Author: scw00 <[email protected]>
AuthorDate: Wed Jan 16 15:01:40 2019 +0800
Fixes unmatched port when looking up HostDB
---
proxy/http/HttpSM.cc | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 875dba8..e9ea12a 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -4096,10 +4096,14 @@ HttpSM::do_hostdb_lookup()
// If there is not a current server, we must be looking up the origin
// server at the beginning of the transaction
- int server_port = t_state.current.server ?
- t_state.current.server->dst_addr.host_order_port() :
- t_state.server_info.dst_addr.isValid() ?
t_state.server_info.dst_addr.host_order_port() :
-
t_state.hdr_info.client_request.port_get();
+ int server_port = 0;
+ if (t_state.current.server && t_state.current.server->dst_addr.isValid()) {
+ server_port = t_state.current.server->dst_addr.host_order_port();
+ } else if (t_state.server_info.dst_addr.isValid()) {
+ server_port = t_state.server_info.dst_addr.host_order_port();
+ } else {
+ server_port = t_state.hdr_info.client_request.port_get();
+ }
if (t_state.api_txn_dns_timeout_value != -1) {
SMDebug("http_timeout", "beginning DNS lookup. allowing %d mseconds for
DNS lookup", t_state.api_txn_dns_timeout_value);