update sni handler
This commit is contained in:
@ -1,20 +1,10 @@
|
||||
package sni
|
||||
|
||||
import (
|
||||
"net"
|
||||
"io"
|
||||
)
|
||||
|
||||
type cacheConn struct {
|
||||
net.Conn
|
||||
buf []byte
|
||||
}
|
||||
|
||||
func (c *cacheConn) Read(b []byte) (n int, err error) {
|
||||
if len(c.buf) > 0 {
|
||||
n = copy(b, c.buf)
|
||||
c.buf = c.buf[n:]
|
||||
return
|
||||
}
|
||||
|
||||
return c.Conn.Read(b)
|
||||
type readWriter struct {
|
||||
io.Reader
|
||||
io.Writer
|
||||
}
|
||||
|
Reference in New Issue
Block a user