[ https://issues.apache.org/jira/browse/TS-3018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14098571#comment-14098571 ]
kang li commented on TS-3018: ----------------------------- There is another issue that when I try to use TSUrlPortSet to change the port of a client request. But that seems won't take effect except I also set the host in the url. I'm not clear if this is by design. But the issue quite confuse me that I use the interface but that doesn't work. Util I read the code, that if we can read the host from the url then we can read the port. {code} 1470 if (0 != url->host_get(&m_host_length)) { 1471 m_target_in_url = true; 1472 m_port = url->port_get(); 1473 m_port_in_header = 0 != url->port_get_raw(); 1474 m_host_mime = NULL; {code} > Client Request's default port can't be changed after scheme was changed > ----------------------------------------------------------------------- > > Key: TS-3018 > URL: https://issues.apache.org/jira/browse/TS-3018 > Project: Traffic Server > Issue Type: Bug > Components: HTTP > Reporter: kang li > > If I received a client request with scheme http and there are no port set in > Host header or absolute URI in http request. Then I change the scheme to > https. But when in url remap, it still get the port as 80 which indicated by > the previous scheme. > {code} > 1475 } else if (0 != (m_host_mime = > const_cast<HTTPHdr*>(this)->get_host_port_values(0, &m_host_length, > &port_ptr, 0))) { > 1476 if (port_ptr) { > 1477 m_port = 0; > 1478 for ( ; is_digit(*port_ptr) ; ++port_ptr ) > 1479 m_port = m_port * 10 + *port_ptr - '0'; > 1480 m_port_in_header = (0 != m_port); > 1481 } > 1482 m_port = url_canonicalize_port(url->m_url_impl->m_url_type, m_port); > {code} > That seems the m_port was not reset to 0 when it second time try to get the > port by url type (which was reset in UrlSchemeSet). So it always get the port > in the initial time. -- This message was sent by Atlassian JIRA (v6.2#6252)