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

Side by Side Diff: net/tools/quic/quic_simple_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/quic_client_bin.cc ('k') | net/tools/quic/quic_time_wait_list_manager.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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 port = url.EffectiveIntPort(); 255 port = url.EffectiveIntPort();
256 } 256 }
257 if (!net::ParseIPLiteralToNumber(host, &ip_addr)) { 257 if (!net::ParseIPLiteralToNumber(host, &ip_addr)) {
258 net::AddressList addresses; 258 net::AddressList addresses;
259 int rv = net::tools::SynchronousHostResolver::Resolve(host, &addresses); 259 int rv = net::tools::SynchronousHostResolver::Resolve(host, &addresses);
260 if (rv != net::OK) { 260 if (rv != net::OK) {
261 LOG(ERROR) << "Unable to resolve '" << host 261 LOG(ERROR) << "Unable to resolve '" << host
262 << "' : " << net::ErrorToShortString(rv); 262 << "' : " << net::ErrorToShortString(rv);
263 return 1; 263 return 1;
264 } 264 }
265 ip_addr = addresses[0].address(); 265 ip_addr = addresses[0].address().bytes();
266 } 266 }
267 267
268 string host_port = net::IPAddressToStringWithPort(ip_addr, FLAGS_port); 268 string host_port = net::IPAddressToStringWithPort(ip_addr, FLAGS_port);
269 VLOG(1) << "Resolved " << host << " to " << host_port << endl; 269 VLOG(1) << "Resolved " << host << " to " << host_port << endl;
270 270
271 // Build the client, and try to connect. 271 // Build the client, and try to connect.
272 net::QuicServerId server_id(url.host(), url.EffectiveIntPort(), 272 net::QuicServerId server_id(url.host(), url.EffectiveIntPort(),
273 net::PRIVACY_MODE_DISABLED); 273 net::PRIVACY_MODE_DISABLED);
274 net::QuicVersionVector versions = net::QuicSupportedVersions(); 274 net::QuicVersionVector versions = net::QuicSupportedVersions();
275 if (FLAGS_quic_version != -1) { 275 if (FLAGS_quic_version != -1) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 return 0; 388 return 0;
389 } else { 389 } else {
390 cout << "Request failed (redirect " << response_code << ")." << endl; 390 cout << "Request failed (redirect " << response_code << ")." << endl;
391 return 1; 391 return 1;
392 } 392 }
393 } else { 393 } else {
394 cerr << "Request failed (" << response_code << ")." << endl; 394 cerr << "Request failed (" << response_code << ")." << endl;
395 return 1; 395 return 1;
396 } 396 }
397 } 397 }
OLDNEW
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | net/tools/quic/quic_time_wait_list_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698