Fix failing unit test due to the connection not being a tcp connection in tests.

This commit is contained in:
notsure2 2023-06-11 01:40:03 +03:00
parent e2e8a8e9be
commit 391c017956
1 changed files with 14 additions and 12 deletions

View File

@ -32,7 +32,8 @@ func MakeSession(connConfig RemoteConnConfig, authInfo AuthInfo, dialer common.D
goto makeconn
}
tcpConn := remoteConn.(*net.TCPConn)
tcpConn, ok := remoteConn.(*net.TCPConn)
if ok {
syscallConn, err := tcpConn.SyscallConn()
if err != nil {
panic(err)
@ -47,6 +48,7 @@ func MakeSession(connConfig RemoteConnConfig, authInfo AuthInfo, dialer common.D
if err != nil {
panic(err)
}
}
transportConn := connConfig.TransportMaker()
sk, err := transportConn.Handshake(remoteConn, authInfo)