Chore: delay reject

This commit is contained in:
yaling888
2022-05-04 19:49:04 +08:00
parent 3c07ba6b56
commit 045b67524c
6 changed files with 71 additions and 50 deletions

View File

@ -347,11 +347,11 @@ func ReCreateTun(tunConf *config.Tun, tunAddressPrefix *netip.Prefix, tcpIn chan
tunAddressPrefix = lastTunAddressPrefix
}
if !hasTunConfigChange(tunConf, tunAddressPrefix) {
return
}
if tunStackListener != nil {
if !hasTunConfigChange(tunConf, tunAddressPrefix) {
return
}
_ = tunStackListener.Close()
tunStackListener = nil
lastTunConf = nil
@ -388,9 +388,9 @@ func ReCreateMitm(port int, tcpIn chan<- C.ConnContext) {
if mitmListener.RawAddress() == addr {
return
}
tunnel.MitmOutbound = nil
_ = mitmListener.Close()
mitmListener = nil
tunnel.SetMitmOutbound(nil)
}
if portIsZero(addr) {
@ -442,7 +442,7 @@ func ReCreateMitm(port int, tcpIn chan<- C.ConnContext) {
return
}
tunnel.MitmOutbound = outbound.NewMitm(mitmListener.Address())
tunnel.SetMitmOutbound(outbound.NewMitm(mitmListener.Address()))
log.Infoln("Mitm proxy listening at: %s", mitmListener.Address())
}