murfffi commented on code in PR #3488:
URL: https://github.com/apache/thrift/pull/3488#discussion_r3252193561
##########
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:
Thanks for the review! I agree that the version is more convoluted and thus
error prone .
I wondered if it is likely that, in the future, Go team makes *tls.Config
implement syscall.Conn directly, possibly to utilize
https://docs.kernel.org/networking/tls-offload.html on Linux.
I though about this more and I believe that if something drastic like that
happens, the syscall code may not work and we will better unwrapping the
connection anyway.
I changed it back to the variant in JIRA. Please take another look.
--
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]