Fix clang error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]

This commit is contained in:
AJR 2022-03-20 16:15:58 -04:00
parent 6a91b86301
commit 6b088758c7
2 changed files with 6 additions and 6 deletions

View File

@ -399,19 +399,19 @@ void tipi_card_device::open_websocket()
m_wsclient = std::make_unique<webpp::ws_client>(shost);
webpp::ws_client* wsc = m_wsclient.get();
wsc->on_open =
[wsc,this]()
[this]()
{ websocket_opened(); };
wsc->on_message =
[wsc,this](std::shared_ptr<webpp::ws_client::Message> message)
[this](std::shared_ptr<webpp::ws_client::Message> message)
{ websocket_incoming(message); };
wsc->on_close =
[wsc,this](int i, const std::string& msg)
[this](int i, const std::string& msg)
{ websocket_closed(i, msg); };
wsc->on_error =
[wsc,this](const std::error_code& code)
[this](const std::error_code& code)
{ websocket_error(code); };
m_send_stream = std::make_shared<webpp::ws_client::SendStream>();

View File

@ -363,7 +363,7 @@ namespace webpp {
if(first_bytes[1]>=128) {
const std::string reason("message from server masked");
auto kept_connection=connection;
send_close(1002, reason, [this, kept_connection](const std::error_code& /*ec*/) {});
send_close(1002, reason, [](const std::error_code& /*ec*/) {});
if(on_close)
on_close(1002, reason);
return;
@ -441,7 +441,7 @@ namespace webpp {
auto reason=message->string();
auto kept_connection=connection;
send_close(status, reason, [this, kept_connection](const std::error_code& /*ec*/) {});
send_close(status, reason, [](const std::error_code& /*ec*/) {});
if(on_close)
on_close(status, reason);
return;