Skip to content

Commit

Permalink
Fix several typos throughout the codebase
Browse files Browse the repository at this point in the history
As detected by an automatic spell checker.
  • Loading branch information
stv0g committed Nov 13, 2022
1 parent 9ab8f71 commit 90a16ec
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions agent_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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())
}

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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()))

Expand Down
12 changes: 6 additions & 6 deletions external_ip_mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down
6 changes: 3 additions & 3 deletions ice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tcptype.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 90a16ec

Please sign in to comment.