delete port after error

pull/219/head
v2ray 2016-07-24 10:08:06 +02:00
parent edd9885d0e
commit 723a693c78
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 2 additions and 0 deletions

View File

@ -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