Browse Source

Fix a potential issue mentioned in #81

v2ray 9 năm trước cách đây
mục cha
commit
131e6bf239
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      proxy/shadowsocks/shadowsocks.go

+ 3 - 1
proxy/shadowsocks/shadowsocks.go

@@ -63,7 +63,6 @@ func (this *Shadowsocks) Listen(port v2net.Port) error {
 			return proxy.ErrorAlreadyListening
 		}
 	}
-	this.accepting = true
 
 	tcpHub, err := hub.ListenTCP(port, this.handleConnection)
 	if err != nil {
@@ -82,6 +81,9 @@ func (this *Shadowsocks) Listen(port v2net.Port) error {
 		this.udpHub = udpHub
 	}
 
+	this.port = port
+	this.accepting = true
+
 	return nil
 }