Skip to content

Commit

Permalink
Sync mutex when cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dviejokfs committed Feb 15, 2023
1 parent 43fbf77 commit 4297d03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ type SessionRegistry struct {
}

func (s *Session) cleanup() {
s.Lock()
defer s.Unlock()
defer func() {
s.cleanupDone = true
}()
Expand Down Expand Up @@ -341,6 +343,7 @@ func NewServerCmd() *cobra.Command {
}

type Session struct {
sync.RWMutex
cleanupDone bool
SNI string `json:"sni"`
//RemoteAddr string `json:"remoteAddr"`
Expand Down

0 comments on commit 4297d03

Please sign in to comment.