From 830e651f9994557314e9de138eaaf14f037b101b Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 18 Aug 2017 07:12:44 -0700 Subject: [PATCH] Fix argument parsing in HTTP examples fix #746 --- CHANGELOG.md | 6 ++++++ example/advanced/server-flex/advanced_server_flex.cpp | 2 +- example/advanced/server/advanced_server.cpp | 2 +- example/http/server/async-ssl/http_server_async_ssl.cpp | 2 +- example/http/server/async/http_server_async.cpp | 2 +- example/http/server/coro-ssl/http_server_coro_ssl.cpp | 2 +- example/http/server/coro/http_server_coro.cpp | 2 +- example/http/server/flex/http_server_flex.cpp | 2 +- .../http/server/stackless-ssl/http_server_stackless_ssl.cpp | 2 +- example/http/server/stackless/http_server_stackless.cpp | 2 +- 10 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf3abd2..caf1838a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 108: + +* Fix argument parsing in HTTP examples + +-------------------------------------------------------------------------------- + Version 107: * Use test::stream diff --git a/example/advanced/server-flex/advanced_server_flex.cpp b/example/advanced/server-flex/advanced_server_flex.cpp index bf180dff..951769e6 100644 --- a/example/advanced/server-flex/advanced_server_flex.cpp +++ b/example/advanced/server-flex/advanced_server_flex.cpp @@ -1116,7 +1116,7 @@ int main(int argc, char* argv[]) auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); std::string const doc_root = argv[3]; - auto const threads = std::max(1, std::atoi(argv[3])); + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads}; diff --git a/example/advanced/server/advanced_server.cpp b/example/advanced/server/advanced_server.cpp index a5846a5a..a9f5bac7 100644 --- a/example/advanced/server/advanced_server.cpp +++ b/example/advanced/server/advanced_server.cpp @@ -682,7 +682,7 @@ int main(int argc, char* argv[]) auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); std::string const doc_root = argv[3]; - auto const threads = std::max(1, std::atoi(argv[3])); + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads}; diff --git a/example/http/server/async-ssl/http_server_async_ssl.cpp b/example/http/server/async-ssl/http_server_async_ssl.cpp index ebb7ae0e..415f3010 100644 --- a/example/http/server/async-ssl/http_server_async_ssl.cpp +++ b/example/http/server/async-ssl/http_server_async_ssl.cpp @@ -460,7 +460,7 @@ int main(int argc, char* argv[]) auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); std::string const doc_root = argv[3]; - auto const threads = std::max(1, std::atoi(argv[3])); + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads}; diff --git a/example/http/server/async/http_server_async.cpp b/example/http/server/async/http_server_async.cpp index b0f8a83e..20b20e6e 100644 --- a/example/http/server/async/http_server_async.cpp +++ b/example/http/server/async/http_server_async.cpp @@ -425,7 +425,7 @@ int main(int argc, char* argv[]) auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); std::string const doc_root = argv[3]; - auto const threads = std::max(1, std::atoi(argv[3])); + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads}; diff --git a/example/http/server/coro-ssl/http_server_coro_ssl.cpp b/example/http/server/coro-ssl/http_server_coro_ssl.cpp index e92b9770..592a1fde 100644 --- a/example/http/server/coro-ssl/http_server_coro_ssl.cpp +++ b/example/http/server/coro-ssl/http_server_coro_ssl.cpp @@ -356,8 +356,8 @@ int main(int argc, char* argv[]) } auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); - auto const threads = std::max(1, std::atoi(argv[3])); std::string const doc_root = argv[3]; + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads}; diff --git a/example/http/server/coro/http_server_coro.cpp b/example/http/server/coro/http_server_coro.cpp index 0a6777f9..2a9e63ed 100644 --- a/example/http/server/coro/http_server_coro.cpp +++ b/example/http/server/coro/http_server_coro.cpp @@ -339,8 +339,8 @@ int main(int argc, char* argv[]) } auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); - auto const threads = std::max(1, std::atoi(argv[3])); std::string const doc_root = argv[3]; + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads}; diff --git a/example/http/server/flex/http_server_flex.cpp b/example/http/server/flex/http_server_flex.cpp index 8e60d7cc..09445e90 100644 --- a/example/http/server/flex/http_server_flex.cpp +++ b/example/http/server/flex/http_server_flex.cpp @@ -624,7 +624,7 @@ int main(int argc, char* argv[]) auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); std::string const doc_root = argv[3]; - auto const threads = std::max(1, std::atoi(argv[3])); + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads}; diff --git a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp index 3cb7430f..8a79f13c 100644 --- a/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp +++ b/example/http/server/stackless-ssl/http_server_stackless_ssl.cpp @@ -446,7 +446,7 @@ int main(int argc, char* argv[]) auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); std::string const doc_root = argv[3]; - auto const threads = std::max(1, std::atoi(argv[3])); + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads}; diff --git a/example/http/server/stackless/http_server_stackless.cpp b/example/http/server/stackless/http_server_stackless.cpp index ecb36788..6ff4aac1 100644 --- a/example/http/server/stackless/http_server_stackless.cpp +++ b/example/http/server/stackless/http_server_stackless.cpp @@ -419,7 +419,7 @@ int main(int argc, char* argv[]) auto const address = boost::asio::ip::address::from_string(argv[1]); auto const port = static_cast(std::atoi(argv[2])); std::string const doc_root = argv[3]; - auto const threads = std::max(1, std::atoi(argv[3])); + auto const threads = std::max(1, std::atoi(argv[4])); // The io_service is required for all I/O boost::asio::io_service ios{threads};