You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/10/18 17:04:25 UTC

[GitHub] [trafficserver] shinrich commented on a diff in pull request #9150: Fix transparent tr-pass

shinrich commented on code in PR #9150:
URL: https://github.com/apache/trafficserver/pull/9150#discussion_r998497925


##########
proxy/http/HttpSM.cc:
##########
@@ -651,17 +651,22 @@ HttpSM::setup_blind_tunnel_port()
   NetVConnection *netvc = ua_txn->get_netvc();
   ink_release_assert(netvc);
   int host_len;
-  if (auto *tts = dynamic_cast<TLSTunnelSupport *>(netvc)) {
-    if (!t_state.hdr_info.client_request.url_get()->host_get(&host_len)) {
-      // the URL object has not been created in the start of the transaction. Hence, we need to create the URL here
-      URL u;
 
-      t_state.hdr_info.client_request.create(HTTP_TYPE_REQUEST);
-      t_state.hdr_info.client_request.method_set(HTTP_METHOD_CONNECT, HTTP_LEN_CONNECT);
-      t_state.hdr_info.client_request.url_create(&u);
-      u.scheme_set(URL_SCHEME_TUNNEL, URL_LEN_TUNNEL);
-      t_state.hdr_info.client_request.url_set(&u);
+  // This applies to both the TLS and non TLS cases
+  if (!t_state.hdr_info.client_request.url_get()->host_get(&host_len)) {
+    // the URL object has not been created in the start of the transaction. Hence, we need to create the URL here
+    URL u;
+
+    t_state.hdr_info.client_request.create(HTTP_TYPE_REQUEST);
+    t_state.hdr_info.client_request.method_set(HTTP_METHOD_CONNECT, HTTP_LEN_CONNECT);
+    t_state.hdr_info.client_request.url_create(&u);
+    u.scheme_set(URL_SCHEME_TUNNEL, URL_LEN_TUNNEL);
+    t_state.hdr_info.client_request.url_set(&u);
+  }
 
+  TLSTunnelSupport *tts = nullptr;
+  if (!ua_txn->is_outbound_transparent() && (tts = dynamic_cast<TLSTunnelSupport *>(netvc))) {
+    if (!t_state.hdr_info.client_request.url_get()->host_get(&host_len)) {

Review Comment:
   Hmm, would have to add another condition to the else on line 683 then.  I think the separation improves the clarity of what we are checking for.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org