maskit commented on code in PR #11631:
URL: https://github.com/apache/trafficserver/pull/11631#discussion_r1698688892


##########
src/api/InkAPI.cc:
##########
@@ -7921,11 +7921,10 @@ TSVConnTunnel(TSVConn sslp)
 TSSslConnection
 TSVConnSslConnectionGet(TSVConn sslp)
 {
-  TSSslConnection    ssl    = nullptr;
-  NetVConnection    *vc     = reinterpret_cast<NetVConnection *>(sslp);
-  SSLNetVConnection *ssl_vc = dynamic_cast<SSLNetVConnection *>(vc);
-  if (ssl_vc != nullptr) {
-    ssl = reinterpret_cast<TSSslConnection>(ssl_vc->ssl);
+  TSSslConnection ssl   = nullptr;
+  NetVConnection *netvc = reinterpret_cast<NetVConnection *>(sslp);
+  if (auto tbs = netvc->get_service<TLSBasicSupport>(); tbs) {
+    ssl = reinterpret_cast<TSSslConnection>(tbs->get_tls_handle());

Review Comment:
   Yes.
   ```
   /Users/mkitajo/src/github.com/trafficserver/src/api/InkAPI.cc:7927:11: 
error: static_cast from 'TLSHandle' (aka 'ssl_st *') to 'TSSslConnection' (aka 
'tsapi_ssl_obj *'), which are not related by inheritance, is not allowed
       ssl = static_cast<TSSslConnection>(tbs->get_tls_handle());
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
/Users/mkitajo/src/github.com/trafficserver/my-build-quiche/include/ts/apidefs.h:1039:32:
 note: 'tsapi_ssl_obj' is incomplete
   using TSSslConnection = struct tsapi_ssl_obj *;
                                  ^
   /Users/mkitajo/opt/boringssl/include/openssl/base.h:376:16: note: 'ssl_st' 
is incomplete
   typedef struct ssl_st SSL;
                  ^
   1 error generated.
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to