From 723a693c786ccda10907dd210e210cc69554c19b Mon Sep 17 00:00:00 2001 From: v2ray Date: Sun, 24 Jul 2016 10:08:06 +0200 Subject: [PATCH] delete port after error --- shell/point/inbound_detour_dynamic.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shell/point/inbound_detour_dynamic.go b/shell/point/inbound_detour_dynamic.go index b1fd5f500..941118077 100644 --- a/shell/point/inbound_detour_dynamic.go +++ b/shell/point/inbound_detour_dynamic.go @@ -104,10 +104,12 @@ func (this *InboundDetourHandlerDynamic) refresh() error { ich, err := proxyrepo.CreateInboundHandler(config.Protocol, this.space, config.Settings, &proxy.InboundHandlerMeta{ Address: config.ListenOn, Port: port, Tag: config.Tag, StreamSettings: config.StreamSettings}) if err != nil { + delete(this.portsInUse, port) return err } err = ich.Start() if err != nil { + delete(this.portsInUse, port) return err } this.portsInUse[port] = true