Prep for boost 1.74.0
Boost 1.74.0 got released the yesterday and deprecated some more stuff
that we use. This patchset prepares us so we will build for it when
meta-oe picks it up.
Tested:
Code builds under boost 1.74.0
Signed-off-by: Ed Tanous <ed@tanous.net>
Change-Id: Icc6c54da6705098fc76e3ee6dbdc6c3b5c57fbda
diff --git a/http/websocket.h b/http/websocket.h
index 5e65c99..61b3463 100644
--- a/http/websocket.h
+++ b/http/websocket.h
@@ -95,9 +95,7 @@
std::string_view protocol = req[bf::sec_websocket_protocol];
- // Perform the websocket upgrade
- ws.async_accept_ex(
- req,
+ ws.set_option(boost::beast::websocket::stream_base::decorator(
[session{session}, protocol{std::string(protocol)}](
boost::beast::websocket::response_type& m) {
@@ -126,15 +124,18 @@
m.insert("X-XSS-Protection", "1; "
"mode=block");
m.insert("X-Content-Type-Options", "nosniff");
- },
- [this, self(shared_from_this())](boost::system::error_code ec) {
- if (ec)
- {
- BMCWEB_LOG_ERROR << "Error in ws.async_accept " << ec;
- return;
- }
- acceptDone();
- });
+ }));
+
+ // Perform the websocket upgrade
+ ws.async_accept(req, [this, self(shared_from_this())](
+ boost::system::error_code ec) {
+ if (ec)
+ {
+ BMCWEB_LOG_ERROR << "Error in ws.async_accept " << ec;
+ return;
+ }
+ acceptDone();
+ });
}
void sendBinary(const std::string_view msg) override