Skip to content

Commit

Permalink
chore: code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Jan 16, 2023
1 parent bec66e9 commit 4e4d741
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 15 deletions.
3 changes: 0 additions & 3 deletions adapter/outbound/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ func (c *conn) AppendToChains(a C.ProxyAdapter) {
}

func (c *conn) Upstream() any {
if wrapper, ok := c.ExtendedConn.(*N.ExtendedConnWrapper); ok {
return wrapper.Conn
}
return c.ExtendedConn
}

Expand Down
3 changes: 0 additions & 3 deletions common/net/bufconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,5 @@ func (c *BufferedConn) ReadBuffer(buffer *buf.Buffer) (err error) {
}

func (c *BufferedConn) Upstream() any {
if wrapper, ok := c.ExtendedConn.(*ExtendedConnWrapper); ok {
return wrapper.Conn
}
return c.ExtendedConn
}
2 changes: 0 additions & 2 deletions common/net/sing.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"github.com/sagernet/sing/common/network"
)

type ExtendedConnWrapper = bufio.ExtendedConnWrapper

var NewExtendedConn = bufio.NewExtendedConn
var NewExtendedWriter = bufio.NewExtendedWriter
var NewExtendedReader = bufio.NewExtendedReader
Expand Down
3 changes: 0 additions & 3 deletions transport/vless/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,6 @@ func (vc *Conn) recvResponse() error {
}

func (vc *Conn) Upstream() any {
if wrapper, ok := vc.ExtendedConn.(*N.ExtendedConnWrapper); ok {
return wrapper.Conn
}
return vc.ExtendedConn
}

Expand Down
4 changes: 0 additions & 4 deletions transport/vmess/websocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@ import (
"strings"
"sync"
"time"
_ "unsafe"

"github.com/Dreamacro/clash/common/buf"
N "github.com/Dreamacro/clash/common/net"

"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 {
conn *websocket.Conn
reader io.Reader
Expand Down

0 comments on commit 4e4d741

Please sign in to comment.