Commit 809f6221 authored by knowledge4igor's avatar knowledge4igor

Revert setting default flags for Endpoing Options

parent 8c09edf5
...@@ -14,7 +14,7 @@ namespace Http { ...@@ -14,7 +14,7 @@ namespace Http {
Endpoint::Options::Options() Endpoint::Options::Options()
: threads_(1) : threads_(1)
, flags_(Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr) , flags_()
, backlog_(Const::MaxBacklog) , backlog_(Const::MaxBacklog)
, maxPayload_(Const::DefaultMaxPayload) , maxPayload_(Const::DefaultMaxPayload)
{ } { }
......
...@@ -21,7 +21,9 @@ TEST(http_client_test, one_client_with_one_request) { ...@@ -21,7 +21,9 @@ TEST(http_client_test, one_client_with_one_request) {
const std::string address = "localhost:9079"; const std::string address = "localhost:9079";
Http::Endpoint server(address); Http::Endpoint server(address);
server.init(); auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
server.serveThreaded(); server.serveThreaded();
...@@ -52,7 +54,9 @@ TEST(http_client_test, one_client_with_multiple_requests) { ...@@ -52,7 +54,9 @@ TEST(http_client_test, one_client_with_multiple_requests) {
const std::string address = "localhost:9080"; const std::string address = "localhost:9080";
Http::Endpoint server(address); Http::Endpoint server(address);
server.init(); auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
server.serveThreaded(); server.serveThreaded();
...@@ -88,7 +92,9 @@ TEST(http_client_test, multiple_clients_with_one_request) { ...@@ -88,7 +92,9 @@ TEST(http_client_test, multiple_clients_with_one_request) {
const std::string address = "localhost:9081"; const std::string address = "localhost:9081";
Http::Endpoint server(address); Http::Endpoint server(address);
server.init(); auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
server.serveThreaded(); server.serveThreaded();
......
...@@ -88,8 +88,11 @@ TEST(payload, from_description) ...@@ -88,8 +88,11 @@ TEST(payload, from_description)
router.initFromDescription(desc); router.initFromDescription(desc);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr;
auto opts = Http::Endpoint::options() auto opts = Http::Endpoint::options()
.threads(threads) .threads(threads)
.flags(flags)
.maxPayload(maxPayload); .maxPayload(maxPayload);
; ;
...@@ -139,6 +142,7 @@ TEST(payload, manual_construction) { ...@@ -139,6 +142,7 @@ TEST(payload, manual_construction) {
Port port(PORT); Port port(PORT);
Address addr(Ipv4::any(), port); Address addr(Ipv4::any(), port);
int threads = 20; int threads = 20;
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr;
size_t maxPayload = 2048; size_t maxPayload = 2048;
auto pid = fork(); auto pid = fork();
...@@ -146,6 +150,7 @@ TEST(payload, manual_construction) { ...@@ -146,6 +150,7 @@ TEST(payload, manual_construction) {
auto endpoint = std::make_shared<Http::Endpoint>(addr); auto endpoint = std::make_shared<Http::Endpoint>(addr);
auto opts = Http::Endpoint::options() auto opts = Http::Endpoint::options()
.threads(threads) .threads(threads)
.flags(flags)
.maxPayload(maxPayload); .maxPayload(maxPayload);
; ;
......
...@@ -63,8 +63,11 @@ TEST(stream, from_description) ...@@ -63,8 +63,11 @@ TEST(stream, from_description)
router.initFromDescription(desc); router.initFromDescription(desc);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr;
auto opts = Http::Endpoint::options() auto opts = Http::Endpoint::options()
.threads(threads) .threads(threads)
.flags(flags)
.maxPayload(1024*1024) .maxPayload(1024*1024)
; ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment