From a848fab5fec3e313e1bf94dffd79561677a18892 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Wed, 12 Jul 2017 13:18:10 +0200 Subject: Adapt http-server to last modifications to libicnet. Change-Id: I5a22a857adee4b7861f1daabbc7450ca6a4208cf Signed-off-by: Mauro Sardara --- http-server/http_server.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http-server/http_server.cc b/http-server/http_server.cc index 6bdf18f2..51994686 100644 --- a/http-server/http_server.cc +++ b/http-server/http_server.cc @@ -54,7 +54,6 @@ HttpServer::HttpServer(unsigned short port, void HttpServer::onIcnRequest(std::shared_ptr &publisher, const uint8_t *buffer, std::size_t size) { - publisher->setTimeout(5); std::shared_ptr request = std::make_shared(publisher); request->getContent().rdbuf()->sputn((char*)buffer, size); @@ -71,6 +70,8 @@ void HttpServer::onIcnRequest(std::shared_ptr if (icn_publishers_.find(request_id) == icn_publishers_.end()) { std::cout << "Received request for: " << request->getPath() << std::endl; icn_publishers_[request_id] = publisher; + icn_publishers_[request_id]->attachPublisher(); + icn_publishers_[request_id]->setTimeout(5); std::cout << "Starting new thread" << std::endl; io_service_.dispatch([this, request, request_id]() { find_resource(nullptr, request); -- cgit 1.2.3-korg