diff --git a/include/mtxclient/http/client.hpp b/include/mtxclient/http/client.hpp index 1c9b2dd4247d0afec6fe44306b8dd04961742b24..16a9c59e266a861939da648f6cbf232d0dc65b6a 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 9364f415752f7d85c9bd774c73dfb54634e3390f..eb0ccb2c40c632132b93d0d8708d0aa67a4f4cf8 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_),