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

Side by Side Diff: net/tools/quic/quic_client_bin.cc

Issue 1565303002: Change IPEndpoint::address() to return a net::IPAddress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase for ChromeOS Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_simple_client_bin.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // A binary wrapper for QuicClient. 5 // A binary wrapper for QuicClient.
6 // Connects to a host using QUIC, sends a request to the provided URL, and 6 // Connects to a host using QUIC, sends a request to the provided URL, and
7 // displays the response. 7 // displays the response.
8 // 8 //
9 // Some usage examples: 9 // Some usage examples:
10 // 10 //
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 port = url.EffectiveIntPort(); 253 port = url.EffectiveIntPort();
254 } 254 }
255 if (!net::ParseIPLiteralToNumber(host, &ip_addr)) { 255 if (!net::ParseIPLiteralToNumber(host, &ip_addr)) {
256 net::AddressList addresses; 256 net::AddressList addresses;
257 int rv = net::tools::SynchronousHostResolver::Resolve(host, &addresses); 257 int rv = net::tools::SynchronousHostResolver::Resolve(host, &addresses);
258 if (rv != net::OK) { 258 if (rv != net::OK) {
259 LOG(ERROR) << "Unable to resolve '" << host 259 LOG(ERROR) << "Unable to resolve '" << host
260 << "' : " << net::ErrorToShortString(rv); 260 << "' : " << net::ErrorToShortString(rv);
261 return 1; 261 return 1;
262 } 262 }
263 ip_addr = addresses[0].address(); 263 ip_addr = addresses[0].address().bytes();
264 } 264 }
265 265
266 string host_port = net::IPAddressToStringWithPort(ip_addr, port); 266 string host_port = net::IPAddressToStringWithPort(ip_addr, port);
267 VLOG(1) << "Resolved " << host << " to " << host_port << endl; 267 VLOG(1) << "Resolved " << host << " to " << host_port << endl;
268 268
269 // Build the client, and try to connect. 269 // Build the client, and try to connect.
270 net::EpollServer epoll_server; 270 net::EpollServer epoll_server;
271 net::QuicServerId server_id(url.host(), url.EffectiveIntPort(), 271 net::QuicServerId server_id(url.host(), url.EffectiveIntPort(),
272 net::PRIVACY_MODE_DISABLED); 272 net::PRIVACY_MODE_DISABLED);
273 net::QuicVersionVector versions = net::QuicSupportedVersions(); 273 net::QuicVersionVector versions = net::QuicSupportedVersions();
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 return 0; 387 return 0;
388 } else { 388 } else {
389 cout << "Request failed (redirect " << response_code << ")." << endl; 389 cout << "Request failed (redirect " << response_code << ")." << endl;
390 return 1; 390 return 1;
391 } 391 }
392 } else { 392 } else {
393 cerr << "Request failed (" << response_code << ")." << endl; 393 cerr << "Request failed (" << response_code << ")." << endl;
394 return 1; 394 return 1;
395 } 395 }
396 } 396 }
OLDNEW
« no previous file with comments | « net/tools/quic/end_to_end_test.cc ('k') | net/tools/quic/quic_simple_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698