diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 17:34:26 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-19 17:34:26 +0000 |
commit | 5779bad3e1753ca61a0de9fa28ce44df63f08579 (patch) | |
tree | cfa12d7ea693f629348d007cdea8f6ea287d087a /net | |
parent | 837db2de2c01bce19a7c68d6ef4770e5951b5f5a (diff) | |
download | chromium_src-5779bad3e1753ca61a0de9fa28ce44df63f08579.zip chromium_src-5779bad3e1753ca61a0de9fa28ce44df63f08579.tar.gz chromium_src-5779bad3e1753ca61a0de9fa28ce44df63f08579.tar.bz2 |
Display the full address list rather than just the first item, in about:net-internals.
This is useful when debugging IPv6 issues since you can see what the fallbacks are.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/271061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/address_list.cc | 3 | ||||
-rw-r--r-- | net/url_request/url_request_view_net_internals_job.cc | 27 |
2 files changed, 22 insertions, 8 deletions
diff --git a/net/base/address_list.cc b/net/base/address_list.cc index 7a18f04..3492b3d 100644 --- a/net/base/address_list.cc +++ b/net/base/address_list.cc @@ -4,9 +4,8 @@ #include "net/base/address_list.h" -#ifdef OS_WIN +#if defined(OS_WIN) #include <ws2tcpip.h> -#include <wspiapi.h> // Needed for Win2k compat. #else #include <netdb.h> #endif diff --git a/net/url_request/url_request_view_net_internals_job.cc b/net/url_request/url_request_view_net_internals_job.cc index f8cf21c..56aa8a8 100644 --- a/net/url_request/url_request_view_net_internals_job.cc +++ b/net/url_request/url_request_view_net_internals_job.cc @@ -2,10 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <sstream> - #include "net/url_request/url_request_view_net_internals_job.h" +#if defined(OS_WIN) +#include <ws2tcpip.h> +#else +#include <netdb.h> +#endif + +#include <sstream> + #include "base/stl_util-inl.h" #include "base/string_util.h" #include "net/base/escape.h" @@ -219,7 +225,7 @@ class HostResolverCacheSubSection : public SubSection { out->append("<table border=1>" "<tr>" "<th>Host</th>" - "<th>First address</th>" + "<th>Address list</th>" "<th>Time to live (ms)</th>" "</tr>"); @@ -243,12 +249,21 @@ class HostResolverCacheSubSection : public SubSection { out->append("<tr style='color:blue'>"); } - std::string address_str = - net::NetAddressToString(entry->addrlist.head()); + // Stringify all of the addresses in the address list, separated + // by newlines (br). + std::string address_list_html; + const struct addrinfo* current_address = entry->addrlist.head(); + while (current_address) { + if (!address_list_html.empty()) + address_list_html += "<br>"; + address_list_html += EscapeForHTML( + net::NetAddressToString(current_address)); + current_address = current_address->ai_next; + } out->append(StringPrintf("<td>%s</td><td>%s</td><td>%d</td></tr>", EscapeForHTML(host).c_str(), - EscapeForHTML(address_str).c_str(), + address_list_html.c_str(), ttl_ms)); } else { // This was an entry that failed to be resolved. |