fishy commented on code in PR #3488:
URL: https://github.com/apache/thrift/pull/3488#discussion_r3250998817


##########
lib/go/thrift/socket_unix_conn.go:
##########
@@ -38,7 +39,14 @@ func (sc *socketConn) read0() error {
 }
 
 func (sc *socketConn) checkConn() error {
-       syscallConn, ok := sc.Conn.(syscall.Conn)
+       rawConn := sc.Conn
+       syscallConn, ok := rawConn.(syscall.Conn)
+       if !ok {
+               if connTLS, isTLS := rawConn.(*tls.Conn); isTLS {
+                       rawConn = connTLS.NetConn()

Review Comment:
   in the jira ticket your proposal was to do this before trying to get 
`syscallConn`. is there a reason you flipped it to this approach?
   
   I like that approach better because that way you don't have the next line 
that rewrites `syscallConn, ok` which is very error-prone (e.g. if you used 
`ok` instead of `isTLS` on line 45 that's a bug that's hard to spot).



-- 
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