diff --git a/context/conn.go b/context/conn.go index 8ecbf56b..71ec232e 100644 --- a/context/conn.go +++ b/context/conn.go @@ -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, } }