mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-02-23 20:52:15 +08:00
chore: code cleanup
This commit is contained in:
parent
bec66e9e69
commit
4e4d741075
@ -188,9 +188,6 @@ func (c *conn) AppendToChains(a C.ProxyAdapter) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *conn) Upstream() any {
|
func (c *conn) Upstream() any {
|
||||||
if wrapper, ok := c.ExtendedConn.(*N.ExtendedConnWrapper); ok {
|
|
||||||
return wrapper.Conn
|
|
||||||
}
|
|
||||||
return c.ExtendedConn
|
return c.ExtendedConn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,5 @@ func (c *BufferedConn) ReadBuffer(buffer *buf.Buffer) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *BufferedConn) Upstream() any {
|
func (c *BufferedConn) Upstream() any {
|
||||||
if wrapper, ok := c.ExtendedConn.(*ExtendedConnWrapper); ok {
|
|
||||||
return wrapper.Conn
|
|
||||||
}
|
|
||||||
return c.ExtendedConn
|
return c.ExtendedConn
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,6 @@ import (
|
|||||||
"github.com/sagernet/sing/common/network"
|
"github.com/sagernet/sing/common/network"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExtendedConnWrapper = bufio.ExtendedConnWrapper
|
|
||||||
|
|
||||||
var NewExtendedConn = bufio.NewExtendedConn
|
var NewExtendedConn = bufio.NewExtendedConn
|
||||||
var NewExtendedWriter = bufio.NewExtendedWriter
|
var NewExtendedWriter = bufio.NewExtendedWriter
|
||||||
var NewExtendedReader = bufio.NewExtendedReader
|
var NewExtendedReader = bufio.NewExtendedReader
|
||||||
|
@ -123,9 +123,6 @@ func (vc *Conn) recvResponse() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (vc *Conn) Upstream() any {
|
func (vc *Conn) Upstream() any {
|
||||||
if wrapper, ok := vc.ExtendedConn.(*N.ExtendedConnWrapper); ok {
|
|
||||||
return wrapper.Conn
|
|
||||||
}
|
|
||||||
return vc.ExtendedConn
|
return vc.ExtendedConn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
_ "unsafe"
|
|
||||||
|
|
||||||
"github.com/Dreamacro/clash/common/buf"
|
"github.com/Dreamacro/clash/common/buf"
|
||||||
N "github.com/Dreamacro/clash/common/net"
|
N "github.com/Dreamacro/clash/common/net"
|
||||||
@ -25,9 +24,6 @@ import (
|
|||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:linkname maskBytes github.com/gorilla/websocket.maskBytes
|
|
||||||
func maskBytes(key [4]byte, pos int, b []byte) int
|
|
||||||
|
|
||||||
type websocketConn struct {
|
type websocketConn struct {
|
||||||
conn *websocket.Conn
|
conn *websocket.Conn
|
||||||
reader io.Reader
|
reader io.Reader
|
||||||
|
Loading…
Reference in New Issue
Block a user