Add SSE filter param support
The Redfish spec require filtering of SSE entries to be supported.
This commit rearranges the code, and implements SSE sorting as well
as support for Last-Event-Id. To do this it adds a dependency on
boost circular_buffer.
Tested:
SSE connections succeed. Show filtered results.
Change-Id: I7aeb266fc40471519674c7b65cd5cc4625019e68
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/http/routing/sserule.hpp b/http/routing/sserule.hpp
index 7f8e284..1a51ab0 100644
--- a/http/routing/sserule.hpp
+++ b/http/routing/sserule.hpp
@@ -38,7 +38,7 @@
boost::beast::http::status::internal_server_error);
}
- void handleUpgrade(const Request& /*req*/,
+ void handleUpgrade(const Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& /*asyncResp*/,
boost::asio::ip::tcp::socket&& adaptor) override
{
@@ -47,9 +47,9 @@
myConnection = std::make_shared<
crow::sse_socket::ConnectionImpl<boost::asio::ip::tcp::socket>>(
std::move(adaptor), openHandler, closeHandler);
- myConnection->start();
+ myConnection->start(req);
}
- void handleUpgrade(const Request& /*req*/,
+ void handleUpgrade(const Request& req,
const std::shared_ptr<bmcweb::AsyncResp>& /*asyncResp*/,
boost::asio::ssl::stream<boost::asio::ip::tcp::socket>&&
adaptor) override
@@ -59,7 +59,7 @@
myConnection = std::make_shared<crow::sse_socket::ConnectionImpl<
boost::asio::ssl::stream<boost::asio::ip::tcp::socket>>>(
std::move(adaptor), openHandler, closeHandler);
- myConnection->start();
+ myConnection->start(req);
}
template <typename Func>
@@ -77,7 +77,8 @@
}
private:
- std::function<void(crow::sse_socket::Connection&)> openHandler;
+ std::function<void(crow::sse_socket::Connection&, const crow::Request&)>
+ openHandler;
std::function<void(crow::sse_socket::Connection&)> closeHandler;
};