Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6010)

Unified Diff: chrome/test/chromedriver/net/websocket.cc

Issue 1879863002: Reland of [chromedriver] Listen on IPv6 on IPv6-only hosts (part 2). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better logging Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/chromedriver/net/net_util.cc ('k') | chrome/test/chromedriver/server/chromedriver_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/net/websocket.cc
diff --git a/chrome/test/chromedriver/net/websocket.cc b/chrome/test/chromedriver/net/websocket.cc
index 0658ea1194de66afe3b58d053f84d8828b235585..a829675bcf6c6040868ebea19baedb45b23eeb61 100644
--- a/chrome/test/chromedriver/net/websocket.cc
+++ b/chrome/test/chromedriver/net/websocket.cc
@@ -14,10 +14,12 @@
#include "base/base64.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/json/json_writer.h"
#include "base/rand_util.h"
#include "base/sha1.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
+#include "base/values.h"
#include "build/build_config.h"
#include "net/base/address_list.h"
#include "net/base/io_buffer.h"
@@ -75,9 +77,17 @@ void WebSocket::Connect(const net::CompletionCallback& callback) {
uint16_t port = static_cast<uint16_t>(url_.EffectiveIntPort());
if (ParseURLHostnameToAddress(url_.host(), &address)) {
addresses = net::AddressList::CreateFromIPAddress(address, port);
- } else if (!ResolveHost(url_.HostNoBrackets(), port, &addresses)) {
- callback.Run(net::ERR_ADDRESS_UNREACHABLE);
- return;
+ } else {
+ if (!ResolveHost(url_.HostNoBrackets(), port, &addresses)) {
+ callback.Run(net::ERR_ADDRESS_UNREACHABLE);
+ return;
+ }
+ base::ListValue endpoints;
+ for (auto endpoint : addresses)
+ endpoints.AppendString(endpoint.ToStringWithoutPort());
+ std::string json;
+ CHECK(base::JSONWriter::Write(endpoints, &json));
+ VLOG(0) << "resolved " << url_.HostNoBrackets() << " to " << json;
}
net::NetLog::Source source;
@@ -116,6 +126,8 @@ bool WebSocket::Send(const std::string& message) {
void WebSocket::OnSocketConnect(int code) {
if (code != net::OK) {
+ VLOG(1) << "failed to connect to " << url_.HostNoBrackets() << " (error "
+ << code << ")";
Close(code);
return;
}
« no previous file with comments | « chrome/test/chromedriver/net/net_util.cc ('k') | chrome/test/chromedriver/server/chromedriver_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698