From 4d152fdeffa4ba84ce20161b7b89861623555152 Mon Sep 17 00:00:00 2001 From: Nicolas Werner <nicolas.werner@hotmail.de> Date: Sun, 22 Dec 2019 23:02:00 +0100 Subject: [PATCH] Fix warning about ignored qualifiers --- include/mtxclient/http/client.hpp | 4 ++-- lib/http/client.cpp | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/mtxclient/http/client.hpp b/include/mtxclient/http/client.hpp index 1c9b2dd42..16a9c59e2 100644 --- a/include/mtxclient/http/client.hpp +++ b/include/mtxclient/http/client.hpp @@ -41,7 +41,7 @@ using Callback = std::function<void(const Response &, RequestErr)>; template<class Response> using HeadersCallback = std::function<void(const Response &, HeaderFields, RequestErr)>; -using TypeErasedCallback = std::function<void(const HeaderFields &, +using TypeErasedCallback = std::function<void(HeaderFields, const std::string &, const boost::system::error_code &, boost::beast::http::status)>; @@ -457,7 +457,7 @@ template<class Response> mtx::http::TypeErasedCallback mtx::http::Client::prepare_callback(HeadersCallback<Response> callback) { - auto type_erased_cb = [callback](const HeaderFields &headers, + auto type_erased_cb = [callback](HeaderFields headers, const std::string &body, const boost::system::error_code &err_code, boost::beast::http::status status_code) { diff --git a/lib/http/client.cpp b/lib/http/client.cpp index 9364f4157..eb0ccb2c4 100644 --- a/lib/http/client.cpp +++ b/lib/http/client.cpp @@ -55,10 +55,7 @@ Client::Client(const std::string &server, uint16_t port) Client::~Client() { p.reset(); } std::shared_ptr<Session> -Client::create_session(std::function<void(const HeaderFields &, - const std::string &, - const boost::system::error_code &, - boost::beast::http::status)> type_erased_cb) +Client::create_session(TypeErasedCallback type_erased_cb) { auto session = std::make_shared<Session>( std::ref(p->ios_), -- GitLab