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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
832 std::unique_ptr<AsyncSocket> socket( | 832 std::unique_ptr<AsyncSocket> socket( |
833 thread_->socketserver()->CreateAsyncSocket(family, SOCK_DGRAM)); | 833 thread_->socketserver()->CreateAsyncSocket(family, SOCK_DGRAM)); |
834 if (!socket) { | 834 if (!socket) { |
835 LOG_ERR(LERROR) << "Socket creation failed"; | 835 LOG_ERR(LERROR) << "Socket creation failed"; |
836 return IPAddress(); | 836 return IPAddress(); |
837 } | 837 } |
838 | 838 |
839 if (socket->Connect(SocketAddress( | 839 if (socket->Connect(SocketAddress( |
840 family == AF_INET ? kPublicIPv4Host : kPublicIPv6Host, kPublicPort)) < | 840 family == AF_INET ? kPublicIPv4Host : kPublicIPv6Host, kPublicPort)) < |
841 0) { | 841 0) { |
842 LOG(LS_INFO) << "Connect failed with " << socket->GetError(); | 842 if (socket->GetError() != ENETUNREACH |
honghaiz3
2016/09/28 19:36:30
Should we log an error message if the query for bo
skvlad
2016/09/28 21:22:54
This would have to be elsewhere in NetworkManager
honghaiz3
2016/09/28 21:33:05
Agree that can be done in a separate CL. Perhaps a
skvlad
2016/09/28 22:27:46
Filed https://bugs.chromium.org/p/webrtc/issues/de
| |
843 && socket->GetError() != EHOSTUNREACH) { | |
844 // Ignore the expected case of "host/net unreachable" - which happens if | |
845 // the network is V4- or V6-only. | |
846 LOG(LS_INFO) << "Connect failed with " << socket->GetError(); | |
847 } | |
843 return IPAddress(); | 848 return IPAddress(); |
844 } | 849 } |
845 return socket->GetLocalAddress().ipaddr(); | 850 return socket->GetLocalAddress().ipaddr(); |
846 } | 851 } |
847 | 852 |
848 void BasicNetworkManager::UpdateNetworksOnce() { | 853 void BasicNetworkManager::UpdateNetworksOnce() { |
849 if (!start_count_) | 854 if (!start_count_) |
850 return; | 855 return; |
851 | 856 |
852 ASSERT(Thread::Current() == thread_); | 857 ASSERT(Thread::Current() == thread_); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
976 std::stringstream ss; | 981 std::stringstream ss; |
977 // Print out the first space-terminated token of the network desc, plus | 982 // Print out the first space-terminated token of the network desc, plus |
978 // the IP address. | 983 // the IP address. |
979 ss << "Net[" << description_.substr(0, description_.find(' ')) | 984 ss << "Net[" << description_.substr(0, description_.find(' ')) |
980 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ | 985 << ":" << prefix_.ToSensitiveString() << "/" << prefix_length_ |
981 << ":" << AdapterTypeToString(type_) << "]"; | 986 << ":" << AdapterTypeToString(type_) << "]"; |
982 return ss.str(); | 987 return ss.str(); |
983 } | 988 } |
984 | 989 |
985 } // namespace rtc | 990 } // namespace rtc |
OLD | NEW |