]> Sergey Matveev's repositories - btrtrc.git/commitdiff
dht.Server.Ping didn't lock structure
authorMatt Joiner <anacrolix@gmail.com>
Mon, 25 Aug 2014 12:14:31 +0000 (22:14 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 25 Aug 2014 12:14:31 +0000 (22:14 +1000)
dht/dht.go

index bf3b3f5a7c45699cacf733a85a6da6242c0af5e7..1f4980b14b31aba15ea47a6310b11838e42b6572 100644 (file)
@@ -483,6 +483,8 @@ func (cni *NodeInfo) UnmarshalCompact(b []byte) error {
 }
 
 func (s *Server) Ping(node *net.UDPAddr) (*transaction, error) {
+       s.mu.Lock()
+       defer s.mu.Unlock()
        return s.query(node, "ping", nil)
 }