Skip to content

Commit

Permalink
Fix capitalization of tracing messages
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Vogel <[email protected]>
  • Loading branch information
stv0g committed Jun 24, 2023
1 parent db5d7ea commit a3435fe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ func (a *Agent) setSelectedPair(p *CandidatePair) {
}

func (a *Agent) pingAllCandidates() {
a.log.Trace("pinging all candidates")
a.log.Trace("Pinging all candidates")

if len(a.checklist) == 0 {
a.log.Warn("Failed to ping without candidate pairs. Connection is not possible yet.")
Expand All @@ -549,7 +549,7 @@ func (a *Agent) pingAllCandidates() {
}

if p.bindingRequestCount > a.maxBindingRequests {
a.log.Tracef("max requests reached for pair %s, marking it as failed", p)
a.log.Tracef("Maximum requests reached for pair %s, marking it as failed", p)
p.state = CandidatePairStateFailed
} else {
a.selector.PingCandidate(p.Local, p.Remote)
Expand Down Expand Up @@ -959,7 +959,7 @@ func (a *Agent) findRemoteCandidate(networkType NetworkType, addr net.Addr) Cand
}

func (a *Agent) sendBindingRequest(m *stun.Message, local, remote Candidate) {
a.log.Tracef("ping STUN from %s to %s", local.String(), remote.String())
a.log.Tracef("Ping STUN from %s to %s", local.String(), remote.String())

a.invalidatePendingBindingRequests(time.Now())
a.pendingBindingRequests = append(a.pendingBindingRequests, bindingRequest{
Expand Down Expand Up @@ -1041,7 +1041,7 @@ func (a *Agent) handleInbound(m *stun.Message, local Candidate, remote net.Addr)
!(m.Type.Class == stun.ClassSuccessResponse ||
m.Type.Class == stun.ClassRequest ||
m.Type.Class == stun.ClassIndication) {
a.log.Tracef("unhandled STUN from %s to %s class(%s) method(%s)", remote, local, m.Type.Class, m.Type.Method)
a.log.Tracef("Unhandled STUN from %s to %s class(%s) method(%s)", remote, local, m.Type.Class, m.Type.Method)
return
}

Expand Down Expand Up @@ -1109,7 +1109,7 @@ func (a *Agent) handleInbound(m *stun.Message, local Candidate, remote net.Addr)
a.addRemoteCandidate(remoteCandidate)
}

a.log.Tracef("inbound STUN (Request) from %s to %s", remote.String(), local.String())
a.log.Tracef("Inbound STUN (Request) from %s to %s", remote.String(), local.String())

a.selector.HandleBindingRequest(m, local, remoteCandidate)
}
Expand Down
2 changes: 1 addition & 1 deletion candidatepair.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ func (p *CandidatePair) Write(b []byte) (int, error) {
func (a *Agent) sendSTUN(msg *stun.Message, local, remote Candidate) {
_, err := local.writeTo(msg.Raw, remote)
if err != nil {
a.log.Tracef("failed to send STUN message: %s", err)
a.log.Tracef("Failed to send STUN message: %s", err)
}
}
14 changes: 7 additions & 7 deletions selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s *controllingSelector) ContactCandidates() {
switch {
case s.agent.getSelectedPair() != nil:
if s.agent.validateSelectedPair() {
s.log.Trace("checking keepalive")
s.log.Trace("Checking keepalive")
s.agent.checkKeepalive()
}
case s.nominatedPair != nil:
Expand Down Expand Up @@ -87,7 +87,7 @@ func (s *controllingSelector) nominatePair(pair *CandidatePair) {
return
}

s.log.Tracef("ping STUN (nominate candidate pair) from %s to %s", pair.Local.String(), pair.Remote.String())
s.log.Tracef("Ping STUN (nominate candidate pair) from %s to %s", pair.Local.String(), pair.Remote.String())
s.agent.sendBindingRequest(msg, pair.Local, pair.Remote)
}

Expand Down Expand Up @@ -130,7 +130,7 @@ func (s *controllingSelector) HandleSuccessResponse(m *stun.Message, local, remo
return
}

s.log.Tracef("inbound STUN (SuccessResponse) from %s to %s", remote.String(), local.String())
s.log.Tracef("Inbound STUN (SuccessResponse) from %s to %s", remote.String(), local.String())
p := s.agent.findPair(local, remote)

if p == nil {
Expand Down Expand Up @@ -173,7 +173,7 @@ func (s *controlledSelector) Start() {
func (s *controlledSelector) ContactCandidates() {
if s.agent.getSelectedPair() != nil {
if s.agent.validateSelectedPair() {
s.log.Trace("checking keepalive")
s.log.Trace("Checking keepalive")
s.agent.checkKeepalive()
}
} else {
Expand Down Expand Up @@ -221,7 +221,7 @@ func (s *controlledSelector) HandleSuccessResponse(m *stun.Message, local, remot
return
}

s.log.Tracef("inbound STUN (SuccessResponse) from %s to %s", remote.String(), local.String())
s.log.Tracef("Inbound STUN (SuccessResponse) from %s to %s", remote.String(), local.String())

p := s.agent.findPair(local, remote)
if p == nil {
Expand All @@ -237,7 +237,7 @@ func (s *controlledSelector) HandleSuccessResponse(m *stun.Message, local, remot
(selectedPair != p && selectedPair.priority() <= p.priority()) {
s.agent.setSelectedPair(p)
} else if selectedPair != p {
s.log.Tracef("ignore nominate new pair %s, already nominated pair %s", p, selectedPair)
s.log.Tracef("Ignore nominate new pair %s, already nominated pair %s", p, selectedPair)
}
}
}
Expand All @@ -262,7 +262,7 @@ func (s *controlledSelector) HandleBindingRequest(m *stun.Message, local, remote
(selectedPair != p && selectedPair.priority() <= p.priority()) {
s.agent.setSelectedPair(p)
} else if selectedPair != p {
s.log.Tracef("ignore nominate new pair %s, already nominated pair %s", p, selectedPair)
s.log.Tracef("Ignore nominate new pair %s, already nominated pair %s", p, selectedPair)
}
} else {
// If the received Binding request triggered a new check to be
Expand Down
2 changes: 1 addition & 1 deletion udp_mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func (m *UDPMuxDefault) connWorker() {
}

if destinationConn == nil {
m.params.Logger.Tracef("dropping packet from %s, addr: %s", udpAddr.String(), addr.String())
m.params.Logger.Tracef("Dropping packet from %s, addr: %s", udpAddr.String(), addr.String())
continue
}

Expand Down

0 comments on commit a3435fe

Please sign in to comment.