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

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

Issue 1240953002: Allow QuicClient to set connection MTU before the handshake is sent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Cleanup_changes_97160447
Patch Set: Created 5 years, 5 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_simple_client.cc ('k') | net/tools/quic/test_tools/limited_mtu_test_writer.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 827e6854b5810bea57e391bd5968f80a0467ccd8..d78403ee974d165e92bf269b1a1076a13d40dcac 100644
--- a/net/tools/quic/quic_simple_client_bin.cc
+++ b/net/tools/quic/quic_simple_client_bin.cc
@@ -92,6 +92,8 @@ bool FLAGS_version_mismatch_ok = false;
// If true, an HTTP response code of 3xx is considered to be a successful
// response, otherwise a failure.
bool FLAGS_redirect_is_success = true;
+// Initial MTU of the connection.
+int32 FLAGS_initial_mtu = 0;
int main(int argc, char *argv[]) {
base::CommandLine::Init(argc, argv);
@@ -120,7 +122,9 @@ int main(int argc, char *argv[]) {
"--version_mismatch_ok if specified a version mismatch in the "
"handshake is not considered a failure\n"
"--redirect_is_success if specified an HTTP response code of 3xx "
- "is considered to be a successful response, otherwise a failure\n";
+ "is considered to be a successful response, otherwise a failure\n"
+ "--initial_mtu=<initial_mtu> specify the initial MTU of the connection"
+ "\n";
cout << help_str;
exit(0);
}
@@ -155,13 +159,21 @@ int main(int argc, char *argv[]) {
if (line->HasSwitch("redirect_is_success")) {
FLAGS_redirect_is_success = true;
}
+ if (line->HasSwitch("initial_mtu")) {
+ if (!base::StringToInt(line->GetSwitchValueASCII("initial_mtu"),
+ &FLAGS_initial_mtu)) {
+ std::cerr << "--initial_mtu must be an integer\n";
+ return 1;
+ }
+ }
VLOG(1) << "server host: " << FLAGS_host << " port: " << FLAGS_port
<< " body: " << FLAGS_body << " headers: " << FLAGS_headers
<< " quiet: " << FLAGS_quiet
<< " quic-version: " << FLAGS_quic_version
<< " version_mismatch_ok: " << FLAGS_version_mismatch_ok
- << " redirect_is_success: " << FLAGS_redirect_is_success;
+ << " redirect_is_success: " << FLAGS_redirect_is_success
+ << " initial_mtu: " << FLAGS_initial_mtu;
base::AtExitManager exit_manager;
base::MessageLoopForIO message_loop;
@@ -203,6 +215,9 @@ int main(int argc, char *argv[]) {
server_id, versions);
scoped_ptr<CertVerifier> cert_verifier;
scoped_ptr<TransportSecurityState> transport_security_state;
+ if (FLAGS_initial_mtu != 0) {
+ client.set_initial_max_packet_length(FLAGS_initial_mtu);
+ }
if (is_https) {
// For secure QUIC we need to verify the cert chain.a
cert_verifier.reset(CertVerifier::CreateDefault());
« no previous file with comments | « net/tools/quic/quic_simple_client.cc ('k') | net/tools/quic/test_tools/limited_mtu_test_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698