| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 QuicServer. It listens forever on --port | 5 // A binary wrapper for QuicServer. It listens forever on --port |
| 6 // (default 6121) until it's killed or ctrl-cd to death. | 6 // (default 6121) until it's killed or ctrl-cd to death. |
| 7 | 7 |
| 8 #include <iostream> | 8 #include <iostream> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 14 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 15 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 16 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
| 17 #include "net/quic/crypto/proof_source_chromium.h" | 16 #include "net/quic/crypto/proof_source_chromium.h" |
| 18 #include "net/quic/quic_protocol.h" | 17 #include "net/quic/quic_protocol.h" |
| 19 #include "net/tools/quic/quic_in_memory_cache.h" | 18 #include "net/tools/quic/quic_in_memory_cache.h" |
| 20 #include "net/tools/quic/quic_simple_server.h" | 19 #include "net/tools/quic/quic_simple_server.h" |
| 21 | 20 |
| 22 // The port the quic server will listen on. | 21 // The port the quic server will listen on. |
| 23 int32 FLAGS_port = 6121; | 22 int32_t FLAGS_port = 6121; |
| 24 | 23 |
| 25 net::ProofSource* CreateProofSource(const base::FilePath& cert_path, | 24 net::ProofSource* CreateProofSource(const base::FilePath& cert_path, |
| 26 const base::FilePath& key_path) { | 25 const base::FilePath& key_path) { |
| 27 net::ProofSourceChromium* proof_source = new net::ProofSourceChromium(); | 26 net::ProofSourceChromium* proof_source = new net::ProofSourceChromium(); |
| 28 CHECK(proof_source->Initialize(cert_path, key_path, base::FilePath())); | 27 CHECK(proof_source->Initialize(cert_path, key_path, base::FilePath())); |
| 29 return proof_source; | 28 return proof_source; |
| 30 } | 29 } |
| 31 | 30 |
| 32 int main(int argc, char* argv[]) { | 31 int main(int argc, char* argv[]) { |
| 33 base::AtExitManager exit_manager; | 32 base::AtExitManager exit_manager; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 88 |
| 90 int rc = server.Listen(net::IPEndPoint(ip, FLAGS_port)); | 89 int rc = server.Listen(net::IPEndPoint(ip, FLAGS_port)); |
| 91 if (rc < 0) { | 90 if (rc < 0) { |
| 92 return 1; | 91 return 1; |
| 93 } | 92 } |
| 94 | 93 |
| 95 base::RunLoop().Run(); | 94 base::RunLoop().Run(); |
| 96 | 95 |
| 97 return 0; | 96 return 0; |
| 98 } | 97 } |
| OLD | NEW |