OLD | NEW |
---|---|
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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 } | 390 } |
391 } | 391 } |
392 | 392 |
393 void UDPPort::SendStunBindingRequest(const rtc::SocketAddress& stun_addr) { | 393 void UDPPort::SendStunBindingRequest(const rtc::SocketAddress& stun_addr) { |
394 if (stun_addr.IsUnresolvedIP()) { | 394 if (stun_addr.IsUnresolvedIP()) { |
395 ResolveStunAddress(stun_addr); | 395 ResolveStunAddress(stun_addr); |
396 | 396 |
397 } else if (socket_->GetState() == rtc::AsyncPacketSocket::STATE_BOUND) { | 397 } else if (socket_->GetState() == rtc::AsyncPacketSocket::STATE_BOUND) { |
398 // Check if |server_addr_| is compatible with the port's ip. | 398 // Check if |server_addr_| is compatible with the port's ip. |
399 if (IsCompatibleAddress(stun_addr)) { | 399 if (IsCompatibleAddress(stun_addr)) { |
400 requests_.Send(new StunBindingRequest(this, true, stun_addr)); | 400 requests_.Send(new StunBindingRequest(this, false, stun_addr)); |
pthatcher1
2015/12/02 22:38:08
Can we change StunBindingRequest::keep_alive_ to S
honghaiz3
2015/12/03 01:00:01
Done.
| |
401 } else { | 401 } else { |
402 // Since we can't send stun messages to the server, we should mark this | 402 // Since we can't send stun messages to the server, we should mark this |
403 // port ready. | 403 // port ready. |
404 LOG(LS_WARNING) << "STUN server address is incompatible."; | 404 LOG(LS_WARNING) << "STUN server address is incompatible."; |
405 OnStunBindingOrResolveRequestFailed(stun_addr); | 405 OnStunBindingOrResolveRequestFailed(stun_addr); |
406 } | 406 } |
407 } | 407 } |
408 } | 408 } |
409 | 409 |
410 bool UDPPort::MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const { | 410 bool UDPPort::MaybeSetDefaultLocalAddress(rtc::SocketAddress* addr) const { |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 const std::vector<Candidate>& existing_candidates = Candidates(); | 504 const std::vector<Candidate>& existing_candidates = Candidates(); |
505 std::vector<Candidate>::const_iterator it = existing_candidates.begin(); | 505 std::vector<Candidate>::const_iterator it = existing_candidates.begin(); |
506 for (; it != existing_candidates.end(); ++it) { | 506 for (; it != existing_candidates.end(); ++it) { |
507 if (it->address() == addr) | 507 if (it->address() == addr) |
508 return true; | 508 return true; |
509 } | 509 } |
510 return false; | 510 return false; |
511 } | 511 } |
512 | 512 |
513 } // namespace cricket | 513 } // namespace cricket |
OLD | NEW |