From a41d720bdccfc74c6cd3114944dfcda7ac745072 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Fri, 23 Aug 2019 12:02:25 +0200 Subject: [PATCH] Fix a couple compliler warnings in JSON API --- src/jsonapi/jsonapi.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/jsonapi/jsonapi.cpp b/src/jsonapi/jsonapi.cpp index eaceacf08..eedac0766 100644 --- a/src/jsonapi/jsonapi.cpp +++ b/src/jsonapi/jsonapi.cpp @@ -280,7 +280,7 @@ JsonApiServer::JsonApiServer(uint16_t port, const std::string& bindAddress, }, true); registerHandler("/rsEvents/registerEventsHandler", - [this](const std::shared_ptr session) + [](const std::shared_ptr session) { const std::multimap headers { @@ -289,8 +289,9 @@ JsonApiServer::JsonApiServer(uint16_t port, const std::string& bindAddress, }; session->yield(rb::OK, headers); - size_t reqSize = session->get_request()->get_header("Content-Length", 0); - session->fetch( reqSize, [this]( + size_t reqSize = static_cast( + session->get_request()->get_header("Content-Length", 0) ); + session->fetch( reqSize, []( const std::shared_ptr session, const rb::Bytes& body ) {