Github user jacksontj commented on a diff in the pull request:
https://github.com/apache/trafficserver/pull/773#discussion_r71536060
--- Diff: proxy/http/HttpTransact.cc ---
@@ -1783,7 +1783,13 @@ HttpTransact::OSDNSLookup(State *s)
// update some state variables with hostdb information that has
// been provided.
ats_ip_copy(&s->server_info.dst_addr, s->host_db_info.ip());
- s->server_info.dst_addr.port() =
htons(s->hdr_info.client_request.port_get()); // now we can set the port.
+ // TODO ideally only if ports aren't defined in remap
+ // If the SRV response has a port number, we should honor it. Otherwise
we do the port defined in remap
+ if (s->dns_info.srv_port) {
+ s->server_info.dst_addr.port() = htons(s->dns_info.srv_port);
+ } else {
+ s->server_info.dst_addr.port() =
htons(s->hdr_info.client_request.port_get()); // now we can set the port.
+ }
--- End diff --
I'll change the conditional-- that definitely makes sense.
From looking at the API callout code-- it does seem like its already broken
:/
It seems that `TSHttpTxnServerAddrSet()` is called before the DNS lookup--
and if so it bypasses the [dns lookup|
https://github.com/apache/trafficserver/blob/master/proxy/http/HttpSM.cc#L7179].
So, I would think in this section of HttpTransact we would want to skip all
port setting if `api_server_addr_set` is true.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---