Skip to content

Commit

Permalink
fix: fix panic when update config (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
Li4n0 authored Sep 24, 2022
1 parent ca911b6 commit 48f55c5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ func (s *Server) Run() {
defer func() {
if s.Enable {
log.Error("DNS Server exited unexpectedly")
s.Enable = false
s.livingLock.Unlock()
}
s.Enable = false
s.livingLock.Unlock()
}()

if err := s.UpdateRules(); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/ftp/ftp.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ func (s *Server) Run() {
defer func() {
if s.Enable {
log.Error("FTP Server exited unexpectedly")
s.Enable = false
s.livingLock.Unlock()
}
s.Enable = false
s.livingLock.Unlock()
}()

if err := s.UpdateRules(); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ func (s *Server) Run() {
defer func() {
if s.Enable {
log.Error("LDAP Server exited unexpectedly")
s.Enable = false
s.livingLock.Unlock()
}
s.Enable = false
s.livingLock.Unlock()
}()

if err := s.UpdateRules(); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ func (s *Server) Run() {
defer func() {
if s.Enable {
log.Error("MySQL Server exited unexpectedly")
s.Enable = false
s.livingLock.Unlock()
}
s.Enable = false
s.livingLock.Unlock()
}()
if err := s.UpdateRules(); err != nil {
log.Error(err.Error())
Expand Down
4 changes: 2 additions & 2 deletions pkg/rmi/rmi.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ func (s *Server) Run() {
defer func() {
if s.Enable {
log.Error("RMI Server exited unexpectedly")
s.Enable = false
s.livingLock.Unlock()
}
s.Enable = false
s.livingLock.Unlock()
}()

if err := s.UpdateRules(); err != nil {
Expand Down

0 comments on commit 48f55c5

Please sign in to comment.