mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
chore: reduce wrapper
This commit is contained in:
parent
baee951657
commit
56fae0b1f5
|
@ -16,10 +16,15 @@ type ConnContext struct {
|
|||
|
||||
func NewConnContext(conn net.Conn, metadata *C.Metadata) *ConnContext {
|
||||
id, _ := uuid.NewV4()
|
||||
|
||||
if _, ok := conn.(*CN.BufferedConn); !ok {
|
||||
conn = CN.NewBufferedConn(conn)
|
||||
}
|
||||
|
||||
return &ConnContext{
|
||||
id: id,
|
||||
metadata: metadata,
|
||||
conn: CN.NewBufferedConn(conn),
|
||||
conn: conn,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user