aboutsummaryrefslogtreecommitdiffstats
path: root/include/http_server.h
diff options
context:
space:
mode:
authorAntony Woods <acron1@gmail.com>2014-10-23 18:33:03 +0100
committerAntony Woods <acron1@gmail.com>2014-10-23 18:33:03 +0100
commit27bf11d35c8ce44fd9fef656e2975712846b9bb2 (patch)
tree7005bb1a5227983464e9a89fb7a381000ce7bb74 /include/http_server.h
parenta5fab23f70e6e33c633ba4b646a41d0851169ad1 (diff)
downloadcrow-27bf11d35c8ce44fd9fef656e2975712846b9bb2.tar.gz
crow-27bf11d35c8ce44fd9fef656e2975712846b9bb2.zip
Re-implemented 'get_middleware()' as suggested, without changing the Server constructor and now no longer encountering hangs
Diffstat (limited to 'include/http_server.h')
-rw-r--r--include/http_server.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/http_server.h b/include/http_server.h
index 484aa83..32e0e42 100644
--- a/include/http_server.h
+++ b/include/http_server.h
@@ -22,12 +22,13 @@ namespace crow
class Server
{
public:
- Server(Handler* handler, uint16_t port, uint16_t concurrency = 1)
+ Server(Handler* handler, uint16_t port, std::tuple<Middlewares...>* middlewares = nullptr, uint16_t concurrency = 1)
: acceptor_(io_service_, tcp::endpoint(asio::ip::address(), port)),
signals_(io_service_, SIGINT, SIGTERM),
handler_(handler),
concurrency_(concurrency),
- port_(port)
+ port_(port),
+ middlewares_(middlewares)
{
}
@@ -120,7 +121,6 @@ namespace crow
uint16_t port_;
unsigned int roundrobin_index_{};
- std::tuple<Middlewares...> middlewares_;
-
+ std::tuple<Middlewares...>* middlewares_;
};
}