Skip to content

Commit

Permalink
fix atomic align
Browse files Browse the repository at this point in the history
  • Loading branch information
hexian000 committed Dec 28, 2022
1 parent 87de430 commit da8537c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hlistener/hlistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ type Stats struct {
type Listener struct {
l net.Listener
c Config
s Stats
// atomic vars need to be aligned
s *Stats
}

func (l *Listener) Accept() (net.Conn, error) {
Expand Down Expand Up @@ -64,5 +65,5 @@ func (l *Listener) Stat() Stats {

// Wrap the raw listener
func Wrap(l net.Listener, c *Config) net.Listener {
return &Listener{l: l, c: *c}
return &Listener{l: l, c: *c, s: &Stats{}}
}

0 comments on commit da8537c

Please sign in to comment.