1
0
mirror of https://github.com/fumiama/terasu.git synced 2026-06-11 05:30:26 +08:00

fix: tls conn nil pointer

This commit is contained in:
源文雨
2024-04-16 14:33:54 +09:00
parent e65650a52c
commit dc4fb1ae72
4 changed files with 70 additions and 35 deletions

View File

@@ -7,7 +7,6 @@ import (
// Use terasu in this TLS conn
func Use(conn *tls.Conn) *tls.Conn {
trsConn := (*trsconn)(unsafe.Pointer(conn))
trsConn.handshakeFn = trsConn.clientHandshake
return (*tls.Conn)(unsafe.Pointer(trsConn))
(*_trsconn)(unsafe.Pointer(conn)).handshakeFn = (*trsconn)(conn).clientHandshake
return conn
}