Browse Source

chore: fix typos (#2694)

pull/2687/merge
GoodDaisy 9 months ago
committed by GitHub
parent
commit
a759ed5548
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      p2p/net/reuseport/dialer.go
  2. 4
      p2p/net/swarm/swarm_dial.go
  3. 2
      p2p/net/upgrader/listener.go
  4. 2
      p2p/protocol/circuitv2/relay/relay.go

2
p2p/net/reuseport/dialer.go

@ -33,7 +33,7 @@ func randAddr(addrs []*net.TCPAddr) *net.TCPAddr {
//
// In-order:
//
// 1. If we're _explicitly_ listening on the prefered source address for the destination address
// 1. If we're _explicitly_ listening on the preferred source address for the destination address
// (per the system's routes), we'll use that listener's port as the source port.
// 2. If we're listening on one or more _unspecified_ addresses (zero address), we'll pick a source
// port from one of these listener's.

4
p2p/net/swarm/swarm_dial.go

@ -426,7 +426,7 @@ var quicDraft29DialMatcher = mafmt.And(mafmt.IP, mafmt.Base(ma.P_UDP), mafmt.Bas
// filterKnownUndialables takes a list of multiaddrs, and removes those
// that we definitely don't want to dial: addresses configured to be blocked,
// IPv6 link-local addresses, addresses without a dial-capable transport,
// addresses that we know to be our own, and addresses with a better tranport
// addresses that we know to be our own, and addresses with a better transport
// available. This is an optimization to avoid wasting time on dials that we
// know are going to fail or for which we have a better alternative.
func (s *Swarm) filterKnownUndialables(p peer.ID, addrs []ma.Multiaddr) (goodAddrs []ma.Multiaddr, addrErrs []TransportError) {
@ -546,7 +546,7 @@ func (s *Swarm) dialAddr(ctx context.Context, p peer.ID, addr ma.Multiaddr, updC
}
// We're recording any error as a failure here.
// Notably, this also applies to cancelations (i.e. if another dial attempt was faster).
// Notably, this also applies to cancellations (i.e. if another dial attempt was faster).
// This is ok since the black hole detector uses a very low threshold (5%).
s.bhd.RecordResult(addr, err == nil)

2
p2p/net/upgrader/listener.go

@ -37,7 +37,7 @@ type listener struct {
// Close closes the listener.
func (l *listener) Close() error {
// Do this first to try to get any relevent errors.
// Do this first to try to get any relevant errors.
err := l.Listener.Close()
l.cancel()

2
p2p/protocol/circuitv2/relay/relay.go

@ -295,7 +295,7 @@ func (r *Relay) handleConnect(s network.Stream, msg *pbv2.HopMessage) pbv2.Statu
destConns := r.conns[dest.ID]
if destConns >= r.rc.MaxCircuits {
r.mx.Unlock()
log.Debugf("refusing connection from %s to %s; too many connecitons to %s", src, dest.ID, dest.ID)
log.Debugf("refusing connection from %s to %s; too many connections to %s", src, dest.ID, dest.ID)
fail(pbv2.Status_RESOURCE_LIMIT_EXCEEDED)
return pbv2.Status_RESOURCE_LIMIT_EXCEEDED
}

Loading…
Cancel
Save