Skip to content

Commit

Permalink
Fix the conflict between global variable sessions in socks/socks.go a…
Browse files Browse the repository at this point in the history
…nd local variable session in pickConn function of socks/socks.go.

Signed-off-by: lanxuage <zx1456817554@gmail.com>
  • Loading branch information
LanXuage committed Mar 9, 2023
1 parent ec957b8 commit 9fb3940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions socks/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func listenClient(port string) {
}

func forward(conn net.Conn) {
scfConn := pickConn(sessions)
scfConn := pickConn()

_forward := func(src, dest net.Conn) {
defer src.Close()
Expand All @@ -74,7 +74,7 @@ func forward(conn net.Conn) {

}

func pickConn(sessions []*yamux.Session) net.Conn {
func pickConn() net.Conn {
for {
l := len(sessions)
if l == 0 {
Expand Down

0 comments on commit 9fb3940

Please sign in to comment.