From f3ab58ea2e7f57f4e34685b178b71ff4a6a31025 Mon Sep 17 00:00:00 2001 From: v2ray Date: Sun, 24 Jan 2016 11:51:20 +0100 Subject: [PATCH] remove port closed --- shell/point/inbound_detour_dynamic.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell/point/inbound_detour_dynamic.go b/shell/point/inbound_detour_dynamic.go index c496daef0..cd186c6df 100644 --- a/shell/point/inbound_detour_dynamic.go +++ b/shell/point/inbound_detour_dynamic.go @@ -95,9 +95,10 @@ func (this *InboundDetourHandlerDynamic) refresh() error { this.ich2Recycle, this.ichInUse = this.ichInUse, this.ich2Recycle for _, ich := range this.ichInUse { + delete(this.portsInUse, ich.port) + ich.handler.Close() ich.port = this.pickUnusedPort() err := retry.Timed(100 /* times */, 100 /* ms */).On(func() error { - ich.handler.Close() err := ich.handler.Listen(ich.port) if err != nil { log.Error("Point: Failed to start inbound detour on port ", ich.port, ": ", err)