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

Unified Diff: net/tools/quic/quic_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/quic/quic_stream_factory_test.cc ('k') | net/tools/quic/quic_simple_client_bin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_client_bin.cc
diff --git a/net/tools/quic/quic_client_bin.cc b/net/tools/quic/quic_client_bin.cc
index 06ef771ac8d768c6709fbadefd047d3253c180cc..a905aa0e93fdab375225d0f2fb9b043401c0f2eb 100644
--- a/net/tools/quic/quic_client_bin.cc
+++ b/net/tools/quic/quic_client_bin.cc
@@ -77,7 +77,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.
@@ -182,13 +182,15 @@ int main(int argc, char *argv[]) {
// Determine IP address to connect to from supplied hostname.
net::IPAddressNumber ip_addr;
- // TODO(rtenneti): GURL's doesn't support default_protocol argument, thus
- // protocol is required in the URL.
GURL url(urls[0]);
string host = FLAGS_host;
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);
@@ -200,19 +202,19 @@ int main(int argc, char *argv[]) {
ip_addr = addresses[0].address();
}
- string host_port = net::IPAddressToStringWithPort(ip_addr, FLAGS_port);
+ string host_port = net::IPAddressToStringWithPort(ip_addr, port);
VLOG(1) << "Resolved " << host << " to " << host_port << endl;
// Build the client, and try to connect.
net::EpollServer epoll_server;
- net::QuicServerId server_id(url.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::QuicClient client(net::IPEndPoint(ip_addr, FLAGS_port), server_id,
+ net::tools::QuicClient client(net::IPEndPoint(ip_addr, port), server_id,
versions, &epoll_server);
scoped_ptr<CertVerifier> cert_verifier;
scoped_ptr<TransportSecurityState> transport_security_state;
« no previous file with comments | « net/quic/quic_stream_factory_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