diff options
author | szym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-07 21:44:56 +0000 |
---|---|---|
committer | szym@chromium.org <szym@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-07 21:44:56 +0000 |
commit | 7054e78fe6a2fcda72b06dc196b5f91cfdc75872 (patch) | |
tree | 2efdd9b07a784a17905d737df9b762d88a6cd1c4 /jingle | |
parent | cd46545164adf645d744f3955b256cf89412cdc6 (diff) | |
download | chromium_src-7054e78fe6a2fcda72b06dc196b5f91cfdc75872.zip chromium_src-7054e78fe6a2fcda72b06dc196b5f91cfdc75872.tar.gz chromium_src-7054e78fe6a2fcda72b06dc196b5f91cfdc75872.tar.bz2 |
Reimplements net::AddressList without struct addrinfo.
net::AddressList extends std::vector<std::IPEndPoint> by canonical name. (Canonical name is planned to be removed as well.)
Removes dependency on sys_addrinfo.h throughout the codebase.
Introduces net::SockaddrStorage for convenience.
BUG=125696
TEST=green waterfall
Review URL: http://codereview.chromium.org/10309002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r-- | jingle/notifier/base/chrome_async_socket.cc | 3 | ||||
-rw-r--r-- | jingle/notifier/communicator/xmpp_connection_generator.cc | 15 |
2 files changed, 8 insertions, 10 deletions
diff --git a/jingle/notifier/base/chrome_async_socket.cc b/jingle/notifier/base/chrome_async_socket.cc index e3a243f..1fba65c 100644 --- a/jingle/notifier/base/chrome_async_socket.cc +++ b/jingle/notifier/base/chrome_async_socket.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -19,7 +19,6 @@ #include "net/base/io_buffer.h" #include "net/base/net_util.h" #include "net/base/ssl_config_service.h" -#include "net/base/sys_addrinfo.h" #include "net/socket/client_socket_factory.h" #include "net/socket/client_socket_handle.h" #include "net/socket/ssl_client_socket.h" diff --git a/jingle/notifier/communicator/xmpp_connection_generator.cc b/jingle/notifier/communicator/xmpp_connection_generator.cc index d1a9404a..3611dae0 100644 --- a/jingle/notifier/communicator/xmpp_connection_generator.cc +++ b/jingle/notifier/communicator/xmpp_connection_generator.cc @@ -23,7 +23,6 @@ #include "jingle/notifier/communicator/connection_options.h" #include "jingle/notifier/communicator/connection_settings.h" #include "net/base/net_errors.h" -#include "net/base/sys_addrinfo.h" #include "talk/base/httpcommon-inl.h" #include "talk/base/task.h" #include "talk/base/thread.h" @@ -156,17 +155,17 @@ void XmppConnectionGenerator::HandleServerDNSResolved(int status) { } // Slurp the addresses into a vector. - std::vector<uint32> ip_list; - for (const addrinfo* addr = address_list_.head(); - addr != NULL; addr = addr->ai_next) { - const sockaddr_in& sockaddr = - *reinterpret_cast<const sockaddr_in*>(addr->ai_addr); - uint32 ip = talk_base::NetworkToHost32(sockaddr.sin_addr.s_addr); + std::vector<uint32> ip_list; // TODO(szym): not IPv6-safe. + for (size_t i = 0; i < address_list_.size(); ++i) { + const net::IPEndPoint& addr = address_list_[i]; + DCHECK_EQ(addr.GetFamily(), AF_INET); + uint32 ip = talk_base::NetworkToHost32( + *reinterpret_cast<const uint32*>(&addr.address()[0])); ip_list.push_back(ip); } successfully_resolved_dns_ = !ip_list.empty(); - for (int i = 0; i < static_cast<int>(ip_list.size()); ++i) { + for (size_t i = 0; i < ip_list.size(); ++i) { VLOG(1) << " ip " << i << " : " << talk_base::SocketAddress::IPToString(ip_list[i]); } |