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. Connects to --hostname via --address | 5 // A binary wrapper for QuicClient. Connects to --hostname via --address |
6 // on --port and requests URLs specified on the command line. | 6 // on --port and requests URLs specified on the command line. |
7 // Pass --secure to check the certificates using proof verifier. | 7 // Pass --secure to check the certificates using proof verifier. |
8 // Pass --initial_flow_control_window to specify the size of the initial flow | 8 // Pass --initial_flow_control_window to specify the size of the initial flow |
9 // control receive window to advertise to server. | 9 // control receive window to advertise to server. |
10 // | 10 // |
(...skipping 17 matching lines...) Expand all Loading... |
28 int32 FLAGS_port = 6121; | 28 int32 FLAGS_port = 6121; |
29 std::string FLAGS_address = "127.0.0.1"; | 29 std::string FLAGS_address = "127.0.0.1"; |
30 // The hostname the quic client will connect to. | 30 // The hostname the quic client will connect to. |
31 std::string FLAGS_hostname = "localhost"; | 31 std::string FLAGS_hostname = "localhost"; |
32 // Size of the initial flow control receive window to advertise to server. | 32 // Size of the initial flow control receive window to advertise to server. |
33 int32 FLAGS_initial_flow_control_window = 100 * net::kMaxPacketSize; | 33 int32 FLAGS_initial_flow_control_window = 100 * net::kMaxPacketSize; |
34 // Check the certificates using proof verifier. | 34 // Check the certificates using proof verifier. |
35 bool FLAGS_secure = false; | 35 bool FLAGS_secure = false; |
36 | 36 |
37 int main(int argc, char *argv[]) { | 37 int main(int argc, char *argv[]) { |
38 CommandLine::Init(argc, argv); | 38 base::CommandLine::Init(argc, argv); |
39 CommandLine* line = CommandLine::ForCurrentProcess(); | 39 base::CommandLine* line = base::CommandLine::ForCurrentProcess(); |
40 | 40 |
41 logging::LoggingSettings settings; | 41 logging::LoggingSettings settings; |
42 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 42 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
43 CHECK(logging::InitLogging(settings)); | 43 CHECK(logging::InitLogging(settings)); |
44 | 44 |
45 if (line->HasSwitch("h") || line->HasSwitch("help")) { | 45 if (line->HasSwitch("h") || line->HasSwitch("help")) { |
46 const char* help_str = | 46 const char* help_str = |
47 "Usage: quic_client [options]\n" | 47 "Usage: quic_client [options]\n" |
48 "\n" | 48 "\n" |
49 "Options:\n" | 49 "Options:\n" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 net::PRIVACY_MODE_DISABLED), | 86 net::PRIVACY_MODE_DISABLED), |
87 net::QuicSupportedVersions(), true, FLAGS_initial_flow_control_window); | 87 net::QuicSupportedVersions(), true, FLAGS_initial_flow_control_window); |
88 | 88 |
89 client.Initialize(); | 89 client.Initialize(); |
90 | 90 |
91 if (!client.Connect()) return 1; | 91 if (!client.Connect()) return 1; |
92 | 92 |
93 client.SendRequestsAndWaitForResponse(line->GetArgs()); | 93 client.SendRequestsAndWaitForResponse(line->GetArgs()); |
94 return 0; | 94 return 0; |
95 } | 95 } |
OLD | NEW |