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

Side by Side Diff: webrtc/p2p/base/stunport.cc

Issue 1470363002: Revert "GetDefaultLocalAddress should return false when the address is invalid" (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « webrtc/base/network_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 409
410 bool UDPPort::MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const { 410 bool UDPPort::MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const {
411 if (!addr->IsAnyIP() || !emit_local_for_anyaddress_ || 411 if (!addr->IsAnyIP() || !emit_local_for_anyaddress_ ||
412 !Network()->default_local_address_provider()) { 412 !Network()->default_local_address_provider()) {
413 return true; 413 return true;
414 } 414 }
415 rtc::IPAddress default_address; 415 rtc::IPAddress default_address;
416 bool result = 416 bool result =
417 Network()->default_local_address_provider()->GetDefaultLocalAddress( 417 Network()->default_local_address_provider()->GetDefaultLocalAddress(
418 addr->family(), &default_address); 418 addr->family(), &default_address);
419 if (!result) { 419 if (!result || default_address.IsNil()) {
420 return false; 420 return false;
421 } 421 }
422 422
423 RTC_DCHECK(!default_address.IsNil())
424
425 addr->SetIP(default_address); 423 addr->SetIP(default_address);
426 return true; 424 return true;
427 } 425 }
428 426
429 void UDPPort::OnStunBindingRequestSucceeded( 427 void UDPPort::OnStunBindingRequestSucceeded(
430 const rtc::SocketAddress& stun_server_addr, 428 const rtc::SocketAddress& stun_server_addr,
431 const rtc::SocketAddress& stun_reflected_addr) { 429 const rtc::SocketAddress& stun_reflected_addr) {
432 if (bind_request_succeeded_servers_.find(stun_server_addr) != 430 if (bind_request_succeeded_servers_.find(stun_server_addr) !=
433 bind_request_succeeded_servers_.end()) { 431 bind_request_succeeded_servers_.end()) {
434 return; 432 return;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 const std::vector<Candidate>& existing_candidates = Candidates(); 504 const std::vector<Candidate>& existing_candidates = Candidates();
507 std::vector<Candidate>::const_iterator it = existing_candidates.begin(); 505 std::vector<Candidate>::const_iterator it = existing_candidates.begin();
508 for (; it != existing_candidates.end(); ++it) { 506 for (; it != existing_candidates.end(); ++it) {
509 if (it->address() == addr) 507 if (it->address() == addr)
510 return true; 508 return true;
511 } 509 }
512 return false; 510 return false;
513 } 511 }
514 512
515 } // namespace cricket 513 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/base/network_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698