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

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

Issue 2018693002: Create a new connection if a candidate reuses an address (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: address comments Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | webrtc/p2p/base/stunport.cc » ('j') | 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 #include <algorithm> 10 #include <algorithm>
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 size_t index = 0; 295 size_t index = 0;
296 for (size_t i = 0; i < Candidates().size(); ++i) { 296 for (size_t i = 0; i < Candidates().size(); ++i) {
297 const Candidate& local = Candidates()[i]; 297 const Candidate& local = Candidates()[i];
298 if (local.protocol() == address.protocol()) { 298 if (local.protocol() == address.protocol()) {
299 index = i; 299 index = i;
300 break; 300 break;
301 } 301 }
302 } 302 }
303 303
304 Connection * conn = new ProxyConnection(this, index, address); 304 Connection * conn = new ProxyConnection(this, index, address);
305 AddConnection(conn); 305 AddOrReplaceConnection(conn);
306 return conn; 306 return conn;
307 } 307 }
308 308
309 int RelayPort::SendTo(const void* data, size_t size, 309 int RelayPort::SendTo(const void* data, size_t size,
310 const rtc::SocketAddress& addr, 310 const rtc::SocketAddress& addr,
311 const rtc::PacketOptions& options, 311 const rtc::PacketOptions& options,
312 bool payload) { 312 bool payload) {
313 // Try to find an entry for this specific address. Note that the first entry 313 // Try to find an entry for this specific address. Note that the first entry
314 // created was not given an address initially, so it can be set to the first 314 // created was not given an address initially, so it can be set to the first
315 // address that comes along. 315 // address that comes along.
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 if (rtc::TimeMillis() - start_time_ <= kRetryTimeout) 837 if (rtc::TimeMillis() - start_time_ <= kRetryTimeout)
838 entry_->ScheduleKeepAlive(); 838 entry_->ScheduleKeepAlive();
839 } 839 }
840 840
841 void AllocateRequest::OnTimeout() { 841 void AllocateRequest::OnTimeout() {
842 LOG(INFO) << "Allocate request timed out"; 842 LOG(INFO) << "Allocate request timed out";
843 entry_->HandleConnectFailure(connection_->socket()); 843 entry_->HandleConnectFailure(connection_->socket());
844 } 844 }
845 845
846 } // namespace cricket 846 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | webrtc/p2p/base/stunport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698