chore: reduce wrapper
This commit is contained in:
parent
1fc9e0be99
commit
76bda049b5
1 changed files with 6 additions and 1 deletions
|
@ -16,10 +16,15 @@ type ConnContext struct {
|
||||||
|
|
||||||
func NewConnContext(conn net.Conn, metadata *C.Metadata) *ConnContext {
|
func NewConnContext(conn net.Conn, metadata *C.Metadata) *ConnContext {
|
||||||
id, _ := uuid.NewV4()
|
id, _ := uuid.NewV4()
|
||||||
|
|
||||||
|
if _, ok := conn.(*CN.BufferedConn); !ok {
|
||||||
|
conn = CN.NewBufferedConn(conn)
|
||||||
|
}
|
||||||
|
|
||||||
return &ConnContext{
|
return &ConnContext{
|
||||||
id: id,
|
id: id,
|
||||||
metadata: metadata,
|
metadata: metadata,
|
||||||
conn: CN.NewBufferedConn(conn),
|
conn: conn,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue