Commit 8af2374f authored by archetype's avatar archetype

remove broken Tcp::Options::InstallSignalHandler

Also remove unreachable shutdown() from examples and add
http_server_shutdown example with signal handling.
parent 117db02e
...@@ -11,6 +11,7 @@ pistache_example(http_server) ...@@ -11,6 +11,7 @@ pistache_example(http_server)
pistache_example(http_client) pistache_example(http_client)
pistache_example(rest_server) pistache_example(rest_server)
pistache_example(custom_header) pistache_example(custom_header)
pistache_example(http_server_shutdown)
set(RAPIDJSON_ROOT_DIR PATH "${PROJECT_SOURCE_DIR}/third-party/rapidjson") set(RAPIDJSON_ROOT_DIR PATH "${PROJECT_SOURCE_DIR}/third-party/rapidjson")
......
...@@ -29,6 +29,4 @@ int main() { ...@@ -29,6 +29,4 @@ int main() {
server.init(opts); server.init(opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
server.serve(); server.serve();
server.shutdown();
} }
...@@ -171,12 +171,8 @@ int main(int argc, char *argv[]) { ...@@ -171,12 +171,8 @@ int main(int argc, char *argv[]) {
auto server = std::make_shared<Http::Endpoint>(addr); auto server = std::make_shared<Http::Endpoint>(addr);
auto opts = Http::Endpoint::options() auto opts = Http::Endpoint::options()
.threads(thr) .threads(thr);
.flags(Tcp::Options::InstallSignalHandler);
server->init(opts); server->init(opts);
server->setHandler(Http::make_handler<MyHandler>()); server->setHandler(Http::make_handler<MyHandler>());
server->serve(); server->serve();
std::cout << "Shutdowning server" << std::endl;
server->shutdown();
} }
#include "pistache/endpoint.h"
#include <signal.h>
using namespace Pistache;
class HelloHandler : public Http::Handler {
public:
HTTP_PROTOTYPE(HelloHandler)
void onRequest(const Http::Request& request, Http::ResponseWriter response) override{
UNUSED(request);
response.send(Pistache::Http::Code::Ok, "Hello World\n");
}
};
int main() {
sigset_t signals;
if (sigemptyset(&signals) != 0
|| sigaddset(&signals, SIGTERM) != 0
|| sigaddset(&signals, SIGINT) != 0
|| pthread_sigmask(SIG_BLOCK, &signals, nullptr) != 0) {
perror("install signal handler failed");
return 1;
}
Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(9080));
auto opts = Pistache::Http::Endpoint::options()
.threads(1);
Http::Endpoint server(addr);
server.init(opts);
server.setHandler(Http::make_handler<HelloHandler>());
server.serveThreaded();
int signal = 0;
int status = sigwait(&signals, &signal);
if (status == 0)
{
std::cout << "received signal " << signal << std::endl;
}
else
{
std::cerr << "sigwait returns " << status << std::endl;
}
server.shutdown();
}
...@@ -30,8 +30,7 @@ public: ...@@ -30,8 +30,7 @@ public:
void init(size_t thr = 2) { void init(size_t thr = 2) {
auto opts = Http::Endpoint::options() auto opts = Http::Endpoint::options()
.threads(thr) .threads(thr);
.flags(Tcp::Options::InstallSignalHandler);
httpEndpoint->init(opts); httpEndpoint->init(opts);
createDescription(); createDescription();
} }
...@@ -51,10 +50,6 @@ public: ...@@ -51,10 +50,6 @@ public:
httpEndpoint->serve(); httpEndpoint->serve();
} }
void shutdown() {
httpEndpoint->shutdown();
}
private: private:
void createDescription() { void createDescription() {
desc desc
...@@ -157,6 +152,4 @@ int main(int argc, char *argv[]) { ...@@ -157,6 +152,4 @@ int main(int argc, char *argv[]) {
banker.init(thr); banker.init(thr);
banker.start(); banker.start();
banker.shutdown();
} }
...@@ -39,8 +39,7 @@ public: ...@@ -39,8 +39,7 @@ public:
void init(size_t thr = 2) { void init(size_t thr = 2) {
auto opts = Http::Endpoint::options() auto opts = Http::Endpoint::options()
.threads(thr) .threads(thr);
.flags(Tcp::Options::InstallSignalHandler);
httpEndpoint->init(opts); httpEndpoint->init(opts);
setupRoutes(); setupRoutes();
} }
...@@ -50,10 +49,6 @@ public: ...@@ -50,10 +49,6 @@ public:
httpEndpoint->serve(); httpEndpoint->serve();
} }
void shutdown() {
httpEndpoint->shutdown();
}
private: private:
void setupRoutes() { void setupRoutes() {
using namespace Rest; using namespace Rest;
...@@ -170,6 +165,4 @@ int main(int argc, char *argv[]) { ...@@ -170,6 +165,4 @@ int main(int argc, char *argv[]) {
stats.init(thr); stats.init(thr);
stats.start(); stats.start();
stats.shutdown();
} }
...@@ -25,9 +25,7 @@ enum class Options : uint64_t { ...@@ -25,9 +25,7 @@ enum class Options : uint64_t {
Linger = NoDelay << 1, Linger = NoDelay << 1,
FastOpen = Linger << 1, FastOpen = Linger << 1,
QuickAck = FastOpen << 1, QuickAck = FastOpen << 1,
ReuseAddr = QuickAck << 1, ReuseAddr = QuickAck << 1
ReverseLookup = ReuseAddr << 1,
InstallSignalHandler = ReverseLookup << 1
}; };
DECLARE_FLAGS_OPERATORS(Options) DECLARE_FLAGS_OPERATORS(Options)
......
...@@ -191,10 +191,7 @@ namespace Polling { ...@@ -191,10 +191,7 @@ namespace Polling {
Epoll::poll(std::vector<Event>& events, const std::chrono::milliseconds timeout) const { Epoll::poll(std::vector<Event>& events, const std::chrono::milliseconds timeout) const {
struct epoll_event evs[Const::MaxEvents]; struct epoll_event evs[Const::MaxEvents];
int ready_fds = -1; int ready_fds = epoll_wait(epoll_fd, evs, Const::MaxEvents, timeout.count());
do {
ready_fds = epoll_wait(epoll_fd, evs, Const::MaxEvents, timeout.count());
} while (ready_fds < 0 && errno == EINTR);
for (int i = 0; i < ready_fds; ++i) { for (int i = 0; i < ready_fds; ++i) {
const struct epoll_event *ev = evs + i; const struct epoll_event *ev = evs + i;
......
...@@ -37,21 +37,6 @@ ...@@ -37,21 +37,6 @@
namespace Pistache { namespace Pistache {
namespace Tcp { namespace Tcp {
namespace {
volatile sig_atomic_t g_listen_fd = -1;
void closeListener() {
if (g_listen_fd != -1) {
::close(g_listen_fd);
g_listen_fd = -1;
}
}
void handle_sigint(int) {
closeListener();
}
}
void setSocketOptions(Fd fd, Flags<Options> options) { void setSocketOptions(Fd fd, Flags<Options> options) {
if (options.hasFlag(Options::ReuseAddr)) { if (options.hasFlag(Options::ReuseAddr)) {
int one = 1; int one = 1;
...@@ -129,13 +114,6 @@ Listener::init( ...@@ -129,13 +114,6 @@ Listener::init(
options_ = options; options_ = options;
backlog_ = backlog; backlog_ = backlog;
useSSL_ = false; useSSL_ = false;
if (options_.hasFlag(Options::InstallSignalHandler)) {
if (signal(SIGINT, handle_sigint) == SIG_ERR) {
throw std::runtime_error("Could not install signal handler");
}
}
workers_ = workers; workers_ = workers;
} }
...@@ -213,7 +191,6 @@ Listener::bind(const Address& address) { ...@@ -213,7 +191,6 @@ Listener::bind(const Address& address) {
make_non_blocking(fd); make_non_blocking(fd);
poller.addFd(fd, Polling::NotifyOn::Read, Polling::Tag(fd)); poller.addFd(fd, Polling::NotifyOn::Read, Polling::Tag(fd));
listen_fd = fd; listen_fd = fd;
g_listen_fd = fd;
auto transport = std::make_shared<Transport>(handler_); auto transport = std::make_shared<Transport>(handler_);
...@@ -261,7 +238,6 @@ Listener::run() { ...@@ -261,7 +238,6 @@ Listener::run() {
int ready_fds = poller.poll(events); int ready_fds = poller.poll(events);
if (ready_fds == -1) { if (ready_fds == -1) {
if (errno == EINTR && g_listen_fd == -1) return;
throw Error::system("Polling"); throw Error::system("Polling");
} }
for (const auto& event: events) { for (const auto& event: events) {
......
...@@ -28,7 +28,7 @@ TEST(http_client_test, one_client_with_one_request_with_onecookie) { ...@@ -28,7 +28,7 @@ TEST(http_client_test, one_client_with_one_request_with_onecookie) {
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<CookieHandler>()); server.setHandler(Http::make_handler<CookieHandler>());
...@@ -69,7 +69,7 @@ TEST(http_client_test, one_client_with_one_request_with_several_cookies) { ...@@ -69,7 +69,7 @@ TEST(http_client_test, one_client_with_one_request_with_several_cookies) {
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<CookieHandler>()); server.setHandler(Http::make_handler<CookieHandler>());
......
...@@ -65,7 +65,7 @@ TEST(http_client_test, one_client_with_one_request) ...@@ -65,7 +65,7 @@ TEST(http_client_test, one_client_with_one_request)
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
...@@ -101,7 +101,7 @@ TEST(http_client_test, one_client_with_multiple_requests) ...@@ -101,7 +101,7 @@ TEST(http_client_test, one_client_with_multiple_requests)
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
...@@ -145,7 +145,7 @@ TEST(http_client_test, multiple_clients_with_one_request) { ...@@ -145,7 +145,7 @@ TEST(http_client_test, multiple_clients_with_one_request) {
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
...@@ -211,7 +211,7 @@ TEST(http_client_test, timeout_reject) ...@@ -211,7 +211,7 @@ TEST(http_client_test, timeout_reject)
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<DelayHandler>()); server.setHandler(Http::make_handler<DelayHandler>());
...@@ -249,7 +249,7 @@ TEST(http_client_test, one_client_with_multiple_requests_and_one_connection_per_ ...@@ -249,7 +249,7 @@ TEST(http_client_test, one_client_with_multiple_requests_and_one_connection_per_
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
...@@ -295,7 +295,7 @@ TEST(http_client_test, one_client_with_multiple_requests_and_two_connections_per ...@@ -295,7 +295,7 @@ TEST(http_client_test, one_client_with_multiple_requests_and_two_connections_per
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandler>()); server.setHandler(Http::make_handler<HelloHandler>());
...@@ -341,7 +341,7 @@ TEST(http_client_test, test_client_timeout) ...@@ -341,7 +341,7 @@ TEST(http_client_test, test_client_timeout)
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags).threads(4); auto server_opts = Http::Endpoint::options().flags(flags).threads(4);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<FastEvenPagesHandler>()); server.setHandler(Http::make_handler<FastEvenPagesHandler>());
...@@ -405,7 +405,7 @@ TEST(http_client_test, client_sends_query) ...@@ -405,7 +405,7 @@ TEST(http_client_test, client_sends_query)
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<QueryBounceHandler>()); server.setHandler(Http::make_handler<QueryBounceHandler>());
......
...@@ -130,7 +130,7 @@ TEST(http_server_test, client_disconnection_on_timeout_from_single_threaded_serv ...@@ -130,7 +130,7 @@ TEST(http_server_test, client_disconnection_on_timeout_from_single_threaded_serv
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
const int ONE_SECOND_TIMEOUT = 1; const int ONE_SECOND_TIMEOUT = 1;
...@@ -153,7 +153,7 @@ TEST(http_server_test, client_multiple_requests_disconnection_on_timeout_from_si ...@@ -153,7 +153,7 @@ TEST(http_server_test, client_multiple_requests_disconnection_on_timeout_from_si
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
...@@ -177,7 +177,7 @@ TEST(http_server_test, multiple_client_with_requests_to_multithreaded_server) { ...@@ -177,7 +177,7 @@ TEST(http_server_test, multiple_client_with_requests_to_multithreaded_server) {
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags).threads(3); auto server_opts = Http::Endpoint::options().flags(flags).threads(3);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<HelloHandlerWithDelay>()); server.setHandler(Http::make_handler<HelloHandlerWithDelay>());
...@@ -214,7 +214,7 @@ TEST(http_server_test, multiple_client_with_different_requests_to_multithreaded_ ...@@ -214,7 +214,7 @@ TEST(http_server_test, multiple_client_with_different_requests_to_multithreaded_
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags).threads(4); auto server_opts = Http::Endpoint::options().flags(flags).threads(4);
server.init(server_opts); server.init(server_opts);
const int SIX_SECONDS_DELAY = 6; const int SIX_SECONDS_DELAY = 6;
...@@ -273,7 +273,7 @@ TEST(http_server_test, server_with_static_file) ...@@ -273,7 +273,7 @@ TEST(http_server_test, server_with_static_file)
const Pistache::Address address("localhost", Pistache::Port(0)); const Pistache::Address address("localhost", Pistache::Port(0));
Http::Endpoint server(address); Http::Endpoint server(address);
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
server.setHandler(Http::make_handler<FileHandler>(fileName)); server.setHandler(Http::make_handler<FileHandler>(fileName));
......
...@@ -28,7 +28,7 @@ struct HelloHandler : public Http::Handler { ...@@ -28,7 +28,7 @@ struct HelloHandler : public Http::Handler {
TEST(http_client_test, basic_tls_request) { TEST(http_client_test, basic_tls_request) {
Http::Endpoint server(ADDRESS "1"); Http::Endpoint server(ADDRESS "1");
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
...@@ -65,7 +65,7 @@ TEST(http_client_test, basic_tls_request) { ...@@ -65,7 +65,7 @@ TEST(http_client_test, basic_tls_request) {
TEST(http_client_test, basic_tls_request_with_auth) { TEST(http_client_test, basic_tls_request_with_auth) {
Http::Endpoint server(ADDRESS "2"); Http::Endpoint server(ADDRESS "2");
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
...@@ -106,7 +106,7 @@ TEST(http_client_test, basic_tls_request_with_auth) { ...@@ -106,7 +106,7 @@ TEST(http_client_test, basic_tls_request_with_auth) {
TEST(http_client_test, basic_tls_request_with_auth_no_client_cert) { TEST(http_client_test, basic_tls_request_with_auth_no_client_cert) {
Http::Endpoint server(ADDRESS "3"); Http::Endpoint server(ADDRESS "3");
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
...@@ -144,7 +144,7 @@ TEST(http_client_test, basic_tls_request_with_auth_no_client_cert) { ...@@ -144,7 +144,7 @@ TEST(http_client_test, basic_tls_request_with_auth_no_client_cert) {
TEST(http_client_test, basic_tls_request_with_auth_client_cert_not_signed) { TEST(http_client_test, basic_tls_request_with_auth_client_cert_not_signed) {
Http::Endpoint server(ADDRESS "4"); Http::Endpoint server(ADDRESS "4");
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
...@@ -195,7 +195,7 @@ static int verify_callback(int verify, void *ctx) ...@@ -195,7 +195,7 @@ static int verify_callback(int verify, void *ctx)
TEST(http_client_test, basic_tls_request_with_auth_with_cb) { TEST(http_client_test, basic_tls_request_with_auth_with_cb) {
Http::Endpoint server(ADDRESS "5"); Http::Endpoint server(ADDRESS "5");
auto flags = Tcp::Options::InstallSignalHandler | Tcp::Options::ReuseAddr; auto flags = Tcp::Options::ReuseAddr;
auto server_opts = Http::Endpoint::options().flags(flags); auto server_opts = Http::Endpoint::options().flags(flags);
server.init(server_opts); server.init(server_opts);
......
...@@ -23,8 +23,7 @@ public: ...@@ -23,8 +23,7 @@ public:
void init(size_t thr = 2) { void init(size_t thr = 2) {
auto opts = Http::Endpoint::options() auto opts = Http::Endpoint::options()
.threads(thr) .threads(thr);
.flags(Tcp::Options::InstallSignalHandler);
httpEndpoint->init(opts); httpEndpoint->init(opts);
setupRoutes(); setupRoutes();
} }
......
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