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

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

Issue 2516033003: Landing Recent QUIC changes until Mon Nov 14 04:43:50 2016 +0000 (Closed)
Patch Set: Remove unused UpdatePacketGapSentHistogram() function. Created 4 years 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_server_test.cc ('k') | net/tools/quic/quic_simple_server.h » ('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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "base/strings/stringprintf.h" 50 #include "base/strings/stringprintf.h"
51 #include "net/base/ip_address.h" 51 #include "net/base/ip_address.h"
52 #include "net/base/ip_endpoint.h" 52 #include "net/base/ip_endpoint.h"
53 #include "net/base/net_errors.h" 53 #include "net/base/net_errors.h"
54 #include "net/base/privacy_mode.h" 54 #include "net/base/privacy_mode.h"
55 #include "net/cert/cert_verifier.h" 55 #include "net/cert/cert_verifier.h"
56 #include "net/cert/multi_log_ct_verifier.h" 56 #include "net/cert/multi_log_ct_verifier.h"
57 #include "net/http/http_request_info.h" 57 #include "net/http/http_request_info.h"
58 #include "net/http/transport_security_state.h" 58 #include "net/http/transport_security_state.h"
59 #include "net/quic/chromium/crypto/proof_verifier_chromium.h" 59 #include "net/quic/chromium/crypto/proof_verifier_chromium.h"
60 #include "net/quic/core/quic_error_codes.h"
60 #include "net/quic/core/quic_protocol.h" 61 #include "net/quic/core/quic_protocol.h"
61 #include "net/quic/core/quic_server_id.h" 62 #include "net/quic/core/quic_server_id.h"
62 #include "net/quic/core/quic_utils.h" 63 #include "net/quic/core/quic_utils.h"
63 #include "net/spdy/spdy_header_block.h" 64 #include "net/spdy/spdy_header_block.h"
64 #include "net/spdy/spdy_http_utils.h" 65 #include "net/spdy/spdy_http_utils.h"
65 #include "net/tools/quic/quic_simple_client.h" 66 #include "net/tools/quic/quic_simple_client.h"
66 #include "net/tools/quic/synchronous_host_resolver.h" 67 #include "net/tools/quic/synchronous_host_resolver.h"
67 #include "url/gurl.h" 68 #include "url/gurl.h"
68 69
69 using base::StringPiece; 70 using base::StringPiece;
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 284 }
284 if (!client.Connect()) { 285 if (!client.Connect()) {
285 net::QuicErrorCode error = client.session()->error(); 286 net::QuicErrorCode error = client.session()->error();
286 if (FLAGS_version_mismatch_ok && error == net::QUIC_INVALID_VERSION) { 287 if (FLAGS_version_mismatch_ok && error == net::QUIC_INVALID_VERSION) {
287 cout << "Server talks QUIC, but none of the versions supported by " 288 cout << "Server talks QUIC, but none of the versions supported by "
288 << "this client: " << QuicVersionVectorToString(versions) << endl; 289 << "this client: " << QuicVersionVectorToString(versions) << endl;
289 // Version mismatch is not deemed a failure. 290 // Version mismatch is not deemed a failure.
290 return 0; 291 return 0;
291 } 292 }
292 cerr << "Failed to connect to " << host_port 293 cerr << "Failed to connect to " << host_port
293 << ". Error: " << net::QuicUtils::ErrorToString(error) << endl; 294 << ". Error: " << net::QuicErrorCodeToString(error) << endl;
294 return 1; 295 return 1;
295 } 296 }
296 cout << "Connected to " << host_port << endl; 297 cout << "Connected to " << host_port << endl;
297 298
298 // Construct the string body from flags, if provided. 299 // Construct the string body from flags, if provided.
299 string body = FLAGS_body; 300 string body = FLAGS_body;
300 if (!FLAGS_body_hex.empty()) { 301 if (!FLAGS_body_hex.empty()) {
301 DCHECK(FLAGS_body.empty()) << "Only set one of --body and --body_hex."; 302 DCHECK(FLAGS_body.empty()) << "Only set one of --body and --body_hex.";
302 body = net::QuicUtils::HexDecode(FLAGS_body_hex); 303 body = net::QuicUtils::HexDecode(FLAGS_body_hex);
303 } 304 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 return 0; 370 return 0;
370 } else { 371 } else {
371 cout << "Request failed (redirect " << response_code << ")." << endl; 372 cout << "Request failed (redirect " << response_code << ")." << endl;
372 return 1; 373 return 1;
373 } 374 }
374 } else { 375 } else {
375 cerr << "Request failed (" << response_code << ")." << endl; 376 cerr << "Request failed (" << response_code << ")." << endl;
376 return 1; 377 return 1;
377 } 378 }
378 } 379 }
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server_test.cc ('k') | net/tools/quic/quic_simple_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698