浏览代码

delete port after error

v2ray 9 年之前
父节点
当前提交
723a693c78
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      shell/point/inbound_detour_dynamic.go

+ 2 - 0
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