From 53eee43e7873d5de2ae015b48c1c353dc0a32d92 Mon Sep 17 00:00:00 2001 From: Guo-wei Shieh Date: Wed, 23 Sep 2015 14:09:09 -0700 Subject: [PATCH] Address the comment from 1367553002. Remove duplication introduced by https://codereview.webrtc.org/1367553002 BUG=webrtc:5030 TBR=juberti@webrtc.org Review URL: https://codereview.webrtc.org/1360203003 . Cr-Commit-Position: refs/heads/master@{#10039} --- webrtc/p2p/base/tcpport.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/webrtc/p2p/base/tcpport.cc b/webrtc/p2p/base/tcpport.cc index acaa6404cb..86982b01c6 100644 --- a/webrtc/p2p/base/tcpport.cc +++ b/webrtc/p2p/base/tcpport.cc @@ -374,18 +374,18 @@ void TCPConnection::OnConnect(rtc::AsyncPacketSocket* socket) { // given a binding address, and the platform is expected to pick the // correct local address. const rtc::IPAddress& socket_ip = socket->GetLocalAddress().ipaddr(); - if (socket_ip == port()->ip()) { - LOG_J(LS_VERBOSE, this) << "Connection established to " - << socket->GetRemoteAddress().ToSensitiveString(); - set_connected(true); - connection_pending_ = false; - } else if (IPIsAny(port()->ip())) { - LOG(LS_WARNING) << "Socket is bound to a different address:" - << socket->GetLocalAddress().ipaddr().ToString() - << ", rather then the local port:" - << port()->ip().ToString() - << ". Still allowing it since it's any address" - << ", possibly caused by multi-routes being disabled."; + if (socket_ip == port()->ip() || IPIsAny(port()->ip())) { + if (socket_ip == port()->ip()) { + LOG_J(LS_VERBOSE, this) << "Connection established to " + << socket->GetRemoteAddress().ToSensitiveString(); + } else { + LOG(LS_WARNING) << "Socket is bound to a different address:" + << socket->GetLocalAddress().ipaddr().ToString() + << ", rather then the local port:" + << port()->ip().ToString() + << ". Still allowing it since it's any address" + << ", possibly caused by multi-routes being disabled."; + } set_connected(true); connection_pending_ = false; } else {