OLD | NEW |
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 ip_addr = addresses[0].address(); | 232 ip_addr = addresses[0].address(); |
233 } | 233 } |
234 | 234 |
235 string host_port = net::IPAddressToStringWithPort(ip_addr, port); | 235 string host_port = net::IPAddressToStringWithPort(ip_addr, port); |
236 VLOG(1) << "Resolved " << host << " to " << host_port << endl; | 236 VLOG(1) << "Resolved " << host << " to " << host_port << endl; |
237 | 237 |
238 // Build the client, and try to connect. | 238 // Build the client, and try to connect. |
239 net::EpollServer epoll_server; | 239 net::EpollServer epoll_server; |
240 net::QuicServerId server_id(url.host(), url.EffectiveIntPort(), | 240 net::QuicServerId server_id(url.host(), url.EffectiveIntPort(), |
241 net::PRIVACY_MODE_DISABLED); | 241 net::PRIVACY_MODE_DISABLED); |
242 net::QuicVersionVector versions = net::QuicSupportedVersions(); | 242 net::QuicVersionVector versions = net::AllSupportedVersions(); |
243 if (FLAGS_quic_version != -1) { | 243 if (FLAGS_quic_version != -1) { |
244 versions.clear(); | 244 versions.clear(); |
245 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version)); | 245 versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version)); |
246 } | 246 } |
247 // For secure QUIC we need to verify the cert chain. | 247 // For secure QUIC we need to verify the cert chain. |
248 std::unique_ptr<CertVerifier> cert_verifier(CertVerifier::CreateDefault()); | 248 std::unique_ptr<CertVerifier> cert_verifier(CertVerifier::CreateDefault()); |
249 if (line->HasSwitch("disable-certificate-verification")) { | 249 if (line->HasSwitch("disable-certificate-verification")) { |
250 cert_verifier.reset(new FakeCertVerifier()); | 250 cert_verifier.reset(new FakeCertVerifier()); |
251 } | 251 } |
252 std::unique_ptr<TransportSecurityState> transport_security_state( | 252 std::unique_ptr<TransportSecurityState> transport_security_state( |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 return 0; | 354 return 0; |
355 } else { | 355 } else { |
356 cout << "Request failed (redirect " << response_code << ")." << endl; | 356 cout << "Request failed (redirect " << response_code << ")." << endl; |
357 return 1; | 357 return 1; |
358 } | 358 } |
359 } else { | 359 } else { |
360 cerr << "Request failed (" << response_code << ")." << endl; | 360 cerr << "Request failed (" << response_code << ")." << endl; |
361 return 1; | 361 return 1; |
362 } | 362 } |
363 } | 363 } |
OLD | NEW |