mirror of
https://github.com/pion/ice.git
synced 2025-10-05 15:37:07 +08:00
Assume mDNS candidates are UDPv4 until parsed
Otherwise we are unable to handle remote candidates
This commit is contained in:
@@ -51,6 +51,9 @@ func NewCandidateHost(config *CandidateHostConfig) (*CandidateHost, error) {
|
|||||||
if err := c.setIP(ip); err != nil {
|
if err := c.setIP(ip); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Until mDNS candidate is resolved assume it is UDPv4
|
||||||
|
c.candidateBase.networkType = NetworkTypeUDP4
|
||||||
}
|
}
|
||||||
|
|
||||||
return c, nil
|
return c, nil
|
||||||
|
@@ -274,6 +274,16 @@ func TestCandidateMarshal(t *testing.T) {
|
|||||||
"1052353102 1 tcp 2128609279 192.168.0.196 0 typ host tcptype active",
|
"1052353102 1 tcp 2128609279 192.168.0.196 0 typ host tcptype active",
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
|
{&CandidateHost{
|
||||||
|
candidateBase{
|
||||||
|
networkType: NetworkTypeUDP4,
|
||||||
|
candidateType: CandidateTypeHost,
|
||||||
|
address: "e2494022-4d9a-4c1e-a750-cc48d4f8d6ee.local",
|
||||||
|
port: 60542,
|
||||||
|
},
|
||||||
|
"",
|
||||||
|
},
|
||||||
|
"1380287402 1 udp 2130706431 e2494022-4d9a-4c1e-a750-cc48d4f8d6ee.local 60542 typ host", false},
|
||||||
|
|
||||||
// Invalid candidates
|
// Invalid candidates
|
||||||
{nil, "", true},
|
{nil, "", true},
|
||||||
|
Reference in New Issue
Block a user