From 131e6bf239bf82535b446aa5b6460888aa9e642a Mon Sep 17 00:00:00 2001 From: v2ray Date: Tue, 16 Feb 2016 14:35:24 +0100 Subject: [PATCH] Fix a potential issue mentioned in #81 --- proxy/shadowsocks/shadowsocks.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proxy/shadowsocks/shadowsocks.go b/proxy/shadowsocks/shadowsocks.go index 1dc0519fd..369076986 100644 --- a/proxy/shadowsocks/shadowsocks.go +++ b/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 }