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

Unified Diff: net/tools/quic/quic_simple_client_bin.cc

Issue 1393713003: Remove insecure QUIC support from Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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 | « net/tools/quic/quic_client_bin.cc ('k') | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_simple_client_bin.cc
diff --git a/net/tools/quic/quic_simple_client_bin.cc b/net/tools/quic/quic_simple_client_bin.cc
index 4cc3f32557b478637dffaebad44c93aaec8f1f5d..b2b1246c81b60cdbf9c3feb9eb65486ba239baf2 100644
--- a/net/tools/quic/quic_simple_client_bin.cc
+++ b/net/tools/quic/quic_simple_client_bin.cc
@@ -78,7 +78,7 @@ using std::endl;
// The IP or hostname the quic client will connect to.
string FLAGS_host = "";
// The port to connect to.
-int32 FLAGS_port = 80;
+int32 FLAGS_port = 0;
// If set, send a POST with this body.
string FLAGS_body = "";
// A semicolon separated list of key:value pairs to add to request headers.
@@ -190,6 +190,10 @@ int main(int argc, char *argv[]) {
if (host.empty()) {
host = url.host();
}
+ int port = FLAGS_port;
+ if (port == 0) {
+ port = url.EffectiveIntPort();
+ }
if (!net::ParseIPLiteralToNumber(host, &ip_addr)) {
net::AddressList addresses;
int rv = net::tools::SynchronousHostResolver::Resolve(host, &addresses);
@@ -205,15 +209,15 @@ int main(int argc, char *argv[]) {
VLOG(1) << "Resolved " << host << " to " << host_port << endl;
// Build the client, and try to connect.
- net::QuicServerId server_id(host, FLAGS_port, /*is_https=*/true,
- net::PRIVACY_MODE_DISABLED);
+ net::QuicServerId server_id(url.host(), url.EffectiveIntPort(),
+ /*is_https=*/true, net::PRIVACY_MODE_DISABLED);
net::QuicVersionVector versions = net::QuicSupportedVersions();
if (FLAGS_quic_version != -1) {
versions.clear();
versions.push_back(static_cast<net::QuicVersion>(FLAGS_quic_version));
}
- net::tools::QuicSimpleClient client(net::IPEndPoint(ip_addr, FLAGS_port),
- server_id, versions);
+ net::tools::QuicSimpleClient client(net::IPEndPoint(ip_addr, port), server_id,
+ versions);
scoped_ptr<CertVerifier> cert_verifier;
scoped_ptr<TransportSecurityState> transport_security_state;
client.set_initial_max_packet_length(
« no previous file with comments | « net/tools/quic/quic_client_bin.cc ('k') | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698