Skip to content

Commit

Permalink
Merge pull request #42 from LanXuage/fix-socks_global_var_and_local_v…
Browse files Browse the repository at this point in the history
…ar_conflict

Fix the conflict between global sessions & local sessions  in socks/socks.go
  • Loading branch information
shimmeris authored Mar 10, 2023
2 parents ec957b8 + 9fb3940 commit ca7ce02
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 ca7ce02

Please sign in to comment.