fix: fix DelProxy delay remove reconnect connection

This commit is contained in:
ICKelin
2021-05-01 14:08:08 +08:00
parent 2f5ce825bc
commit 1cf8e1b627
2 changed files with 6 additions and 3 deletions

View File

@@ -118,7 +118,6 @@ func (s *Server) onConn(conn net.Conn) {
vip, err := s.dhcp.SelectIP()
if err != nil {
logs.Error("dhcp select ip fail: %v", err)
// todo reply fail
return
}
@@ -165,7 +164,11 @@ func (s *Server) onConn(conn net.Conn) {
RecycleSignal: make(chan struct{}),
}
s.pluginMgr.AddProxy(item)
err := s.pluginMgr.AddProxy(item)
if err != nil {
logs.Error("add proxy fail: %v", err)
return
}
defer s.pluginMgr.DelProxy(item)
}
}

View File

@@ -23,7 +23,7 @@ type PluginMeta struct {
}
func (item *PluginMeta) identify() string {
return fmt.Sprintf("%s:%s:%s:%s", item.Protocol, item.From, item.To, item.Domain)
return fmt.Sprintf("%s:%s:%s", item.Protocol, item.From, item.Domain)
}
// IPlugin defines proxy plugin API