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()); |