Fix a few data races
This commit is contained in:
parent
9a0f830395
commit
71f5a1882a
|
@ -629,7 +629,10 @@ func (s *Server) serve() error {
|
|||
logonce.Stderr.Printf("received dht packet exceeds buffer size")
|
||||
continue
|
||||
}
|
||||
if s.ipBlocked(util.AddrIP(addr)) {
|
||||
s.mu.Lock()
|
||||
blocked := s.ipBlocked(util.AddrIP(addr))
|
||||
s.mu.Unlock()
|
||||
if blocked {
|
||||
continue
|
||||
}
|
||||
s.processPacket(b[:n], newDHTAddr(addr))
|
||||
|
|
Loading…
Reference in New Issue