mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
proxy: optimize NewConn, avoid loop
This commit is contained in:
1 parent
40ddd1be3a
commit
6fff126e4b
6 files changed
+14
-13
No files matched your search
@@ -28,6 +28,9 @@ type Conn struct {
|
||||
|
||||
// NewConn returns a new conn.
|
||||
func NewConn(c net.Conn) *Conn {
|
||||
if conn, ok := c.(*Conn); ok {
|
||||
return conn
|
||||
}
|
||||
return &Conn{bufio.NewReader(c), c}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user