Bug 1336507 - Part 4: Stop using a magic constant here. r=drno

MozReview-Commit-ID: LgIUrzFFT8I

--HG--
extra : rebase_source : 7ab2848cb8510b24a27c3a2e444727b4105e4f23
This commit is contained in:
Byron Campen [:bwc] 2017-02-03 16:48:30 -06:00
parent 9699169e39
commit 07596f4b60

View File

@ -567,7 +567,11 @@ PeerConnectionConfiguration::AddIceServer(const RTCIceServer &aServer)
if (isStuns || isTurns) {
// Should we barf if transport is set to udp or something?
transport = "tls";
transport = kNrIceTransportTls;
}
if (transport.IsEmpty()) {
transport = kNrIceTransportUdp;
}
if (isTurn || isTurns) {
@ -577,13 +581,11 @@ PeerConnectionConfiguration::AddIceServer(const RTCIceServer &aServer)
if (!addTurnServer(host.get(), port,
username.get(),
credential.get(),
(transport.IsEmpty() ?
kNrIceTransportUdp : transport.get()))) {
transport.get())) {
return NS_ERROR_FAILURE;
}
} else {
if (!addStunServer(host.get(), port, (transport.IsEmpty() ?
kNrIceTransportUdp : transport.get()))) {
if (!addStunServer(host.get(), port, transport.get())) {
return NS_ERROR_FAILURE;
}
}