move relay server priority assignment to port_allocator

which knows more about the internals of ICE.
Remove the relay server config priority field which was used to
specify the relative priority of TURN servers. This is now handled
internally by CreateRelayPortArgs without being exposed.

Also rename BasicPortAllocator::AddTurnServer to
BasicPortAllocator::AddTurnServerForTesting since it is a test-only
method.

BUG=webrtc:13195,webrtc:14539

Change-Id: Id36cbf0187b7a84d1a9b53860f31994f3c7589f0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280224
Commit-Queue: Philipp Hancke <phancke@microsoft.com>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38520}
This commit is contained in:
Philipp Hancke
2022-10-25 13:53:41 +02:00
committed by WebRTC LUCI CQ
parent fd91d02210
commit b395f5bd5c
9 changed files with 48 additions and 43 deletions

View File

@ -237,22 +237,4 @@ TEST_F(IceServerParsingTest, ParseMultipleUrls) {
EXPECT_EQ(1U, turn_servers_.size());
}
// Ensure that TURN servers are given unique priorities,
// so that their resulting candidates have unique priorities.
TEST_F(IceServerParsingTest, TurnServerPrioritiesUnique) {
PeerConnectionInterface::IceServers servers;
PeerConnectionInterface::IceServer server;
server.urls.push_back("turn:hostname");
server.urls.push_back("turn:hostname2");
server.username = "foo";
server.password = "bar";
servers.push_back(server);
EXPECT_TRUE(
webrtc::ParseIceServersOrError(servers, &stun_servers_, &turn_servers_)
.ok());
EXPECT_EQ(2U, turn_servers_.size());
EXPECT_NE(turn_servers_[0].priority, turn_servers_[1].priority);
}
} // namespace webrtc