mirror of
https://github.com/netbirdio/ice.git
synced 2026-05-22 17:10:58 -07:00
Add nominated flag to candidate pair stats
This way we can identify, between the valid candidate, which one has been nominated.
This commit is contained in:
committed by
Hugo Arregui
parent
77a03cd608
commit
d2d97a6293
@@ -457,6 +457,7 @@ func (a *Agent) setSelectedPair(p *candidatePair) {
|
||||
a.onSelectedCandidatePairChange(p)
|
||||
|
||||
a.selectedPair = p
|
||||
a.selectedPair.nominated = true
|
||||
a.updateConnectionState(ConnectionStateConnected)
|
||||
|
||||
// Close mDNS Conn. We don't need to do anymore querying
|
||||
@@ -993,7 +994,7 @@ func (a *Agent) GetCandidatePairsStats() []CandidatePairStats {
|
||||
LocalCandidateID: cp.local.ID(),
|
||||
RemoteCandidateID: cp.remote.ID(),
|
||||
State: cp.state,
|
||||
// Nominated bool
|
||||
Nominated: cp.nominated,
|
||||
// PacketsSent uint32
|
||||
// PacketsReceived uint32
|
||||
// BytesSent uint64
|
||||
|
||||
@@ -22,6 +22,7 @@ type candidatePair struct {
|
||||
local Candidate
|
||||
bindingRequestCount uint16
|
||||
state CandidatePairState
|
||||
nominated bool
|
||||
}
|
||||
|
||||
func (p *candidatePair) String() string {
|
||||
|
||||
@@ -82,6 +82,7 @@ func (s *controllingSelector) ContactCandidates() {
|
||||
p := s.agent.getBestValidCandidatePair()
|
||||
if p != nil && s.isNominatable(p.local) && s.isNominatable(p.remote) {
|
||||
s.log.Tracef("Nominatable pair found, nominating (%s, %s)", p.local.String(), p.remote.String())
|
||||
p.nominated = true
|
||||
s.nominatedPair = p
|
||||
s.nominatePair(p)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user