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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 resolver_.reset(new AddressResolver(socket_factory())); | 365 resolver_.reset(new AddressResolver(socket_factory())); |
366 resolver_->SignalDone.connect(this, &UDPPort::OnResolveResult); | 366 resolver_->SignalDone.connect(this, &UDPPort::OnResolveResult); |
367 } | 367 } |
368 | 368 |
369 resolver_->Resolve(stun_addr); | 369 resolver_->Resolve(stun_addr); |
370 } | 370 } |
371 | 371 |
372 void UDPPort::OnResolveResult(const rtc::SocketAddress& input, | 372 void UDPPort::OnResolveResult(const rtc::SocketAddress& input, |
373 int error) { | 373 int error) { |
374 ASSERT(resolver_.get() != NULL); | 374 ASSERT(resolver_.get() != NULL); |
375 LOG_J(LS_INFO, this) << "STUN host lookup result " << error; | |
pthatcher1
2015/12/02 19:56:32
I think that what we really want is a log just *be
honghaiz3
2015/12/02 23:45:30
Done.
| |
375 | 376 |
376 rtc::SocketAddress resolved; | 377 rtc::SocketAddress resolved; |
377 if (error != 0 || | 378 if (error != 0 || |
378 !resolver_->GetResolvedAddress(input, ip().family(), &resolved)) { | 379 !resolver_->GetResolvedAddress(input, ip().family(), &resolved)) { |
379 LOG_J(LS_WARNING, this) << "StunPort: stun host lookup received error " | |
380 << error; | |
381 OnStunBindingOrResolveRequestFailed(input); | 380 OnStunBindingOrResolveRequestFailed(input); |
382 return; | 381 return; |
383 } | 382 } |
384 | 383 |
385 server_addresses_.erase(input); | 384 server_addresses_.erase(input); |
386 | 385 |
387 if (server_addresses_.find(resolved) == server_addresses_.end()) { | 386 if (server_addresses_.find(resolved) == server_addresses_.end()) { |
388 server_addresses_.insert(resolved); | 387 server_addresses_.insert(resolved); |
389 SendStunBindingRequest(resolved); | 388 SendStunBindingRequest(resolved); |
390 } | 389 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 const std::vector<Candidate>& existing_candidates = Candidates(); | 503 const std::vector<Candidate>& existing_candidates = Candidates(); |
505 std::vector<Candidate>::const_iterator it = existing_candidates.begin(); | 504 std::vector<Candidate>::const_iterator it = existing_candidates.begin(); |
506 for (; it != existing_candidates.end(); ++it) { | 505 for (; it != existing_candidates.end(); ++it) { |
507 if (it->address() == addr) | 506 if (it->address() == addr) |
508 return true; | 507 return true; |
509 } | 508 } |
510 return false; | 509 return false; |
511 } | 510 } |
512 | 511 |
513 } // namespace cricket | 512 } // namespace cricket |
OLD | NEW |