diff options
author | Simon Warta <[email protected]> | 2015-12-08 19:56:19 +0100 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-12-08 22:02:28 +0100 |
commit | 368d087e3973db9d8c5b70443d31c27c03dfdbef (patch) | |
tree | 9059a52c70eee8b825d9fd7fa14194940853b86a /src/cmd/tls_server.cpp | |
parent | 53fca25da331d168b0433ba2e41b06aae9d17f5c (diff) |
Replace C interfaces in cli apps with C++ interfaces
Diffstat (limited to 'src/cmd/tls_server.cpp')
-rw-r--r-- | src/cmd/tls_server.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/cmd/tls_server.cpp b/src/cmd/tls_server.cpp index cd95cf0d6..ea68208b6 100644 --- a/src/cmd/tls_server.cpp +++ b/src/cmd/tls_server.cpp @@ -122,18 +122,18 @@ void alert_received(TLS::Alert alert, const byte[], size_t) std::cout << "Alert: " << alert.type_string() << std::endl; } -int tls_server(int argc, char* argv[]) +int tls_server(const std::vector<std::string> &args) { - if(argc != 4 && argc != 5) + if(args.size() != 4 && args.size() != 5) { - std::cout << "Usage: " << argv[0] << " server.crt server.key port [tcp|udp]" << std::endl; + std::cout << "Usage: " << args[0] << " server.crt server.key port [tcp|udp]" << std::endl; return 1; } - const std::string server_crt = argv[1]; - const std::string server_key = argv[2]; - const int port = to_u32bit(argv[3]); - const std::string transport = (argc >= 5) ? argv[4] : "tcp"; + const std::string server_crt = args[1]; + const std::string server_key = args[2]; + const int port = to_u32bit(args[3]); + const std::string transport = (args.size() >= 5) ? args[4] : "tcp"; const bool is_tcp = (transport == "tcp"); |