Chromium Code Reviews| Index: jingle/notifier/communicator/xmpp_connection_generator.cc |
| diff --git a/jingle/notifier/communicator/xmpp_connection_generator.cc b/jingle/notifier/communicator/xmpp_connection_generator.cc |
| index d1a9404a3855f86a406f4c82881650337e8cb5b5..770904c36c4cb4d709dfd78f438c376762e37848 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,12 +155,12 @@ 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 (net::AddressList::const_iterator addr = address_list_.begin(); |
|
eroman
2012/05/04 01:08:41
Same comment as before. I recommend using an integ
|
| + addr != address_list_.end(); ++addr) { |
| + 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(); |