From 90a16ec70bce85bc56134e9d95b4c4878fc34487 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 12 Nov 2022 14:47:39 +0100 Subject: [PATCH] Fix several typos throughout the codebase As detected by an automatic spell checker. --- agent.go | 4 ++-- agent_config.go | 4 ++-- agent_test.go | 8 ++++---- external_ip_mapper_test.go | 12 ++++++------ ice.go | 6 +++--- stats.go | 2 +- tcptype.go | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/agent.go b/agent.go index 2ed2879..3f0b08c 100644 --- a/agent.go +++ b/agent.go @@ -722,9 +722,9 @@ func (a *Agent) AddRemoteCandidate(c Candidate) error { } // cannot check for network yet because it might not be applied - // when mDNS hostame is used. + // when mDNS hostname is used. if c.TCPType() == TCPTypeActive { - // TCP Candidates with tcptype active will probe server passive ones, so + // TCP Candidates with TCP type active will probe server passive ones, so // no need to do anything with them. a.log.Infof("Ignoring remote candidate with tcpType active: %s", c) return nil diff --git a/agent_config.go b/agent_config.go index 7e5cedd..98bbbff 100644 --- a/agent_config.go +++ b/agent_config.go @@ -109,14 +109,14 @@ type AgentConfig struct { // NAT1To1IPCandidateType is used along with NAT1To1IPs to specify which candidate type // the 1:1 NAT IP addresses should be mapped to. // If unspecified or CandidateTypeHost, NAT1To1IPs are used to replace host candidate IPs. - // If CandidateTypeServerReflexive, it will insert a srflx candidate (as if it was dervied + // If CandidateTypeServerReflexive, it will insert a srflx candidate (as if it was derived // from a STUN server) with its port number being the one for the actual host candidate. // Other values will result in an error. NAT1To1IPCandidateType CandidateType // NAT1To1IPs contains a list of public IP addresses that are to be used as a host // candidate or srflx candidate. This is used typically for servers that are behind - // 1:1 D-NAT (e.g. AWS EC2 instances) and to eliminate the need of server reflexisive + // 1:1 D-NAT (e.g. AWS EC2 instances) and to eliminate the need of server reflexive // candidate gathering. NAT1To1IPs []string diff --git a/agent_test.go b/agent_test.go index 84c273c..befb02f 100644 --- a/agent_test.go +++ b/agent_test.go @@ -235,7 +235,7 @@ func TestHandlePeerReflexive(t *testing.T) { lim := test.TimeOut(time.Second * 2) defer lim.Stop() - t.Run("UDP pflx candidate from handleInbound()", func(t *testing.T) { + t.Run("UDP prflx candidate from handleInbound()", func(t *testing.T) { var config AgentConfig runAgentTest(t, &config, func(ctx context.Context, a *Agent) { a.selector = &controllingSelector{agent: a, log: a.log} @@ -920,7 +920,7 @@ func TestCandidatePairStats(t *testing.T) { } if prflxPairStat.State != CandidatePairStateFailed { - t.Fatalf("expected host-prfflx pair to have state failed, it has state %s instead", + t.Fatalf("expected host-prflx pair to have state failed, it has state %s instead", prflxPairStat.State.String()) } @@ -1232,7 +1232,7 @@ func TestAgentCredentials(t *testing.T) { report := test.CheckRoutines(t) defer report() - // Make sure to pass travis check by disabling the logs + // Make sure to pass Travis check by disabling the logs log := logging.NewDefaultLoggerFactory() log.DefaultLogLevel = logging.LogLevelDisabled @@ -1467,7 +1467,7 @@ func TestAgentRestart(t *testing.T) { <-aConnected <-bConnected - // Assert that we have new candiates each time + // Assert that we have new candidates each time assert.NotEqual(t, connAFirstCandidates, generateCandidateAddressStrings(connA.agent.GetLocalCandidates())) assert.NotEqual(t, connBFirstCandidates, generateCandidateAddressStrings(connB.agent.GetLocalCandidates())) diff --git a/external_ip_mapper_test.go b/external_ip_mapper_test.go index 63a3b2f..7cbce23 100644 --- a/external_ip_mapper_test.go +++ b/external_ip_mapper_test.go @@ -189,15 +189,15 @@ func TestExternalIPMapper(t *testing.T) { assert.Nil(t, m, "should be nil") }) - t.Run("newExternalIPMapper with inplicit and explicit local IP", func(t *testing.T) { - // Mixing inpicit and explicit local IPs not allowed + t.Run("newExternalIPMapper with implicit and explicit local IP", func(t *testing.T) { + // Mixing implicit and explicit local IPs not allowed _, err := newExternalIPMapper(CandidateTypeUnspecified, []string{ "1.2.3.4", "1.2.3.5/10.0.0.1", }) assert.Error(t, err, "should fail") - // Mixing inpicit and explicit local IPs not allowed + // Mixing implicit and explicit local IPs not allowed _, err = newExternalIPMapper(CandidateTypeUnspecified, []string{ "1.2.3.5/10.0.0.1", "1.2.3.4", @@ -226,7 +226,7 @@ func TestExternalIPMapper(t *testing.T) { assert.Equal(t, "1.2.3.4", extIP.String(), "should match") // find external IPv6 - extIP, err = m.findExternalIP("fe80::0001") // use '0001' instead of '1' on purpse + extIP, err = m.findExternalIP("fe80::0001") // use '0001' instead of '1' on purpose assert.NoError(t, err, "should succeed") assert.Equal(t, "2200::1", extIP.String(), "should match") @@ -263,11 +263,11 @@ func TestExternalIPMapper(t *testing.T) { assert.Error(t, err, "should fail") // find external IPv6 - extIP, err = m.findExternalIP("fe80::0001") // use '0001' instead of '1' on purpse + extIP, err = m.findExternalIP("fe80::0001") // use '0001' instead of '1' on purpose assert.NoError(t, err, "should succeed") assert.Equal(t, "2200::1", extIP.String(), "should match") - extIP, err = m.findExternalIP("fe80::0002") // use '0002' instead of '2' on purpse + extIP, err = m.findExternalIP("fe80::0002") // use '0002' instead of '2' on purpose assert.NoError(t, err, "should succeed") assert.Equal(t, "2200::2", extIP.String(), "should match") diff --git a/ice.go b/ice.go index d7094f6..7991c89 100644 --- a/ice.go +++ b/ice.go @@ -52,13 +52,13 @@ func (c ConnectionState) String() string { type GatheringState int const ( - // GatheringStateNew indicates candidate gatering is not yet started + // GatheringStateNew indicates candidate gathering is not yet started GatheringStateNew GatheringState = iota + 1 - // GatheringStateGathering indicates candidate gatering is ongoing + // GatheringStateGathering indicates candidate gathering is ongoing GatheringStateGathering - // GatheringStateComplete indicates candidate gatering has been completed + // GatheringStateComplete indicates candidate gathering has been completed GatheringStateComplete ) diff --git a/stats.go b/stats.go index f59d89f..26c03e5 100644 --- a/stats.go +++ b/stats.go @@ -104,7 +104,7 @@ type CandidatePairStats struct { // ResponsesReceived represents the total number of connectivity check responses received. ResponsesReceived uint64 - // ResponsesSent epresents the total number of connectivity check responses sent. + // ResponsesSent represents the total number of connectivity check responses sent. // Since we cannot distinguish connectivity check requests and consent requests, // all responses are counted. ResponsesSent uint64 diff --git a/tcptype.go b/tcptype.go index 6700fe5..509167d 100644 --- a/tcptype.go +++ b/tcptype.go @@ -3,7 +3,7 @@ package ice import "strings" // TCPType is the type of ICE TCP candidate as described in -// ttps://tools.ietf.org/html/rfc6544#section-4.5 +// https://tools.ietf.org/html/rfc6544#section-4.5 type TCPType int const (