aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara+fdio@cisco.com>2017-07-12 13:18:10 +0200
committerMauro Sardara <msardara+fdio@cisco.com>2017-07-12 13:18:10 +0200
commita848fab5fec3e313e1bf94dffd79561677a18892 (patch)
tree0e31d33ce52bdd125b7e361a8090f00ab72aa24f
parenta5e5e17d29cdc964917a77871f52cfb27ac19e31 (diff)
Adapt http-server to last modifications to libicnet.
Change-Id: I5a22a857adee4b7861f1daabbc7450ca6a4208cf Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
-rw-r--r--http-server/http_server.cc3
1 files changed, 2 insertions, 1 deletions
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<libl4::http::HTTPServerPublisher> &publisher,
const uint8_t *buffer,
std::size_t size) {
- publisher->setTimeout(5);
std::shared_ptr<Request> request = std::make_shared<IcnRequest>(publisher);
request->getContent().rdbuf()->sputn((char*)buffer, size);
@@ -71,6 +70,8 @@ void HttpServer::onIcnRequest(std::shared_ptr<libl4::http::HTTPServerPublisher>
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);