Explorar o código

lib/nat: Avoid concurrent reset of NAT timer (fixes #3337)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3341
Jakob Borg %!s(int64=9) %!d(string=hai) anos
pai
achega
a2dcffcca2
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      lib/nat/service.go

+ 1 - 2
lib/nat/service.go

@@ -44,9 +44,8 @@ func NewService(id protocol.DeviceID, cfg *config.Wrapper) *Service {
 func (s *Service) Serve() {
 	announce := stdsync.Once{}
 
-	s.timer.Reset(0)
-
 	s.mut.Lock()
+	s.timer.Reset(0)
 	s.stop = make(chan struct{})
 	s.mut.Unlock()