Quality Fixup
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
0997406e51
commit
ca63205934
|
@ -121,9 +121,9 @@ type contactRetry struct {
|
||||||
lastCheck time.Time
|
lastCheck time.Time
|
||||||
acnProgress int
|
acnProgress int
|
||||||
|
|
||||||
connections sync.Map //[string]*contact
|
connections sync.Map //[string]*contact
|
||||||
pendingQueue *connectionQueue
|
pendingQueue *connectionQueue
|
||||||
priorityQueue *connectionQueue
|
priorityQueue *connectionQueue
|
||||||
authorizedPeers sync.Map
|
authorizedPeers sync.Map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,14 +232,14 @@ func (cr *contactRetry) run() {
|
||||||
state := connections.ConnectionStateToType()[e.Data[event.ConnectionState]]
|
state := connections.ConnectionStateToType()[e.Data[event.ConnectionState]]
|
||||||
peer := e.Data[event.RemotePeer]
|
peer := e.Data[event.RemotePeer]
|
||||||
// only handle state change events from pre-authorized peers;
|
// only handle state change events from pre-authorized peers;
|
||||||
if _,exists := cr.authorizedPeers.Load(peer); exists {
|
if _, exists := cr.authorizedPeers.Load(peer); exists {
|
||||||
cr.handleEvent(peer, state, peerConn)
|
cr.handleEvent(peer, state, peerConn)
|
||||||
}
|
}
|
||||||
case event.ServerStateChange:
|
case event.ServerStateChange:
|
||||||
state := connections.ConnectionStateToType()[e.Data[event.ConnectionState]]
|
state := connections.ConnectionStateToType()[e.Data[event.ConnectionState]]
|
||||||
server := e.Data[event.GroupServer]
|
server := e.Data[event.GroupServer]
|
||||||
// only handle state change events from pre-authorized servers;
|
// only handle state change events from pre-authorized servers;
|
||||||
if _,exists := cr.authorizedPeers.Load(server); exists {
|
if _, exists := cr.authorizedPeers.Load(server); exists {
|
||||||
cr.handleEvent(server, state, serverConn)
|
cr.handleEvent(server, state, serverConn)
|
||||||
}
|
}
|
||||||
case event.QueueJoinServer:
|
case event.QueueJoinServer:
|
||||||
|
@ -432,7 +432,7 @@ func (cr *contactRetry) handleEvent(id string, state connections.ConnectionState
|
||||||
|
|
||||||
// reject events that contain invalid hostnames...we cannot connect to them
|
// reject events that contain invalid hostnames...we cannot connect to them
|
||||||
// and they could result in spurious connection attempts...
|
// and they could result in spurious connection attempts...
|
||||||
if tor.IsValidHostname(id) == false {
|
if !tor.IsValidHostname(id) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue