Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: webrtc/p2p/base/relayport.cc

Issue 2989303002: Make Port (and subclasses) fully "Network"-based, instead of IP-based. (Closed)
Patch Set: Add back Port constructor that takes IP for backwards compatibility. Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/relayport.h ('k') | webrtc/p2p/base/relayport_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/relayport.cc
diff --git a/webrtc/p2p/base/relayport.cc b/webrtc/p2p/base/relayport.cc
index efb967098b549d0b4752be33a497994b557d7093..387ec4b9fc1d824d263a5f1a7e9fcdbe7e8a5754 100644
--- a/webrtc/p2p/base/relayport.cc
+++ b/webrtc/p2p/base/relayport.cc
@@ -182,7 +182,6 @@ class AllocateRequest : public StunRequest {
RelayPort::RelayPort(rtc::Thread* thread,
rtc::PacketSocketFactory* factory,
rtc::Network* network,
- const rtc::IPAddress& ip,
uint16_t min_port,
uint16_t max_port,
const std::string& username,
@@ -191,7 +190,6 @@ RelayPort::RelayPort(rtc::Thread* thread,
RELAY_PORT_TYPE,
factory,
network,
- ip,
min_port,
max_port,
username,
@@ -489,14 +487,14 @@ void RelayEntry::Connect() {
if (ra->proto == PROTO_UDP) {
// UDP sockets are simple.
socket = port_->socket_factory()->CreateUdpSocket(
- rtc::SocketAddress(port_->ip(), 0),
- port_->min_port(), port_->max_port());
+ rtc::SocketAddress(port_->Network()->GetBestIP(), 0), port_->min_port(),
+ port_->max_port());
} else if (ra->proto == PROTO_TCP || ra->proto == PROTO_SSLTCP) {
int opts = (ra->proto == PROTO_SSLTCP)
? rtc::PacketSocketFactory::OPT_TLS_FAKE
: 0;
socket = port_->socket_factory()->CreateClientTcpSocket(
- rtc::SocketAddress(port_->ip(), 0), ra->address,
+ rtc::SocketAddress(port_->Network()->GetBestIP(), 0), ra->address,
port_->proxy(), port_->user_agent(), opts);
} else {
LOG(LS_WARNING) << "Unknown protocol (" << ra->proto << ")";
« no previous file with comments | « webrtc/p2p/base/relayport.h ('k') | webrtc/p2p/base/relayport_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698