mirror of https://github.com/v2ray/v2ray-core
delete port after error
parent
edd9885d0e
commit
723a693c78
|
@ -104,10 +104,12 @@ func (this *InboundDetourHandlerDynamic) refresh() error {
|
||||||
ich, err := proxyrepo.CreateInboundHandler(config.Protocol, this.space, config.Settings, &proxy.InboundHandlerMeta{
|
ich, err := proxyrepo.CreateInboundHandler(config.Protocol, this.space, config.Settings, &proxy.InboundHandlerMeta{
|
||||||
Address: config.ListenOn, Port: port, Tag: config.Tag, StreamSettings: config.StreamSettings})
|
Address: config.ListenOn, Port: port, Tag: config.Tag, StreamSettings: config.StreamSettings})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
delete(this.portsInUse, port)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = ich.Start()
|
err = ich.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
delete(this.portsInUse, port)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
this.portsInUse[port] = true
|
this.portsInUse[port] = true
|
||||||
|
|
Loading…
Reference in New Issue