Ensuring that UDP TURN servers are always used as STUN servers.
This was already working in most cases, but not for some corner cases:
* If the PORTALLOCATOR_ENABLE_SHARED_SOCKET flag is not set
* If both a STUN server and TURN server are configured
I added unit tests for these cases, and centralized the code that gets
STUN server addresses in order to fix these and any related issues.
BUG=webrtc:4215
Review URL: https://codereview.webrtc.org/1215713003
Cr-Original-Commit-Position: refs/heads/master@{#9596}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: c5d0d95fd8957a7a6645b1196e5f1e9cee33525c
diff --git a/base/proxyserver.cc b/base/proxyserver.cc
index 8f12a99..d91a92f 100644
--- a/base/proxyserver.cc
+++ b/base/proxyserver.cc
@@ -36,6 +36,10 @@
}
}
+SocketAddress ProxyServer::GetServerAddress() {
+ return server_socket_->GetLocalAddress();
+}
+
void ProxyServer::OnAcceptEvent(AsyncSocket* socket) {
ASSERT(socket != NULL && socket == server_socket_.get());
AsyncSocket* int_socket = socket->Accept(NULL);