mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Fix several typos throughout the codebase
As detected by an automatic spell checker.
This commit is contained in:
@@ -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
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
|
||||
+4
-4
@@ -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()))
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user