V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 1 | #pragma once |
Ed Tanous | b289614 | 2024-01-31 15:25:47 -0800 | [diff] [blame] | 2 | #include "http_body.hpp" |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 3 | #include "http_request.hpp" |
| 4 | #include "http_response.hpp" |
| 5 | |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 6 | #include <boost/asio/buffer.hpp> |
| 7 | #include <boost/asio/steady_timer.hpp> |
| 8 | #include <boost/beast/core/multi_buffer.hpp> |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 9 | #include <boost/beast/websocket.hpp> |
| 10 | |
| 11 | #include <array> |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 12 | #include <cstddef> |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 13 | #include <functional> |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 14 | #include <optional> |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 15 | |
| 16 | namespace crow |
| 17 | { |
| 18 | |
| 19 | namespace sse_socket |
| 20 | { |
Ed Tanous | 93cf0ac | 2024-03-28 00:35:13 -0700 | [diff] [blame] | 21 | struct Connection : public std::enable_shared_from_this<Connection> |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 22 | { |
| 23 | public: |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 24 | Connection() = default; |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 25 | |
| 26 | Connection(const Connection&) = delete; |
| 27 | Connection(Connection&&) = delete; |
| 28 | Connection& operator=(const Connection&) = delete; |
| 29 | Connection& operator=(const Connection&&) = delete; |
| 30 | virtual ~Connection() = default; |
| 31 | |
| 32 | virtual boost::asio::io_context& getIoContext() = 0; |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 33 | virtual void close(std::string_view msg = "quit") = 0; |
| 34 | virtual void sendEvent(std::string_view id, std::string_view msg) = 0; |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 35 | }; |
| 36 | |
| 37 | template <typename Adaptor> |
| 38 | class ConnectionImpl : public Connection |
| 39 | { |
| 40 | public: |
Ed Tanous | 93cf0ac | 2024-03-28 00:35:13 -0700 | [diff] [blame] | 41 | ConnectionImpl(Adaptor&& adaptorIn, |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 42 | std::function<void(Connection&)> openHandlerIn, |
| 43 | std::function<void(Connection&)> closeHandlerIn) : |
| 44 | adaptor(std::move(adaptorIn)), |
Ed Tanous | 93cf0ac | 2024-03-28 00:35:13 -0700 | [diff] [blame] | 45 | timer(static_cast<boost::asio::io_context&>( |
| 46 | adaptor.get_executor().context())), |
| 47 | openHandler(std::move(openHandlerIn)), |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 48 | closeHandler(std::move(closeHandlerIn)) |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 49 | |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 50 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 51 | BMCWEB_LOG_DEBUG("SseConnectionImpl: SSE constructor {}", logPtr(this)); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 52 | } |
| 53 | |
| 54 | ConnectionImpl(const ConnectionImpl&) = delete; |
| 55 | ConnectionImpl(const ConnectionImpl&&) = delete; |
| 56 | ConnectionImpl& operator=(const ConnectionImpl&) = delete; |
| 57 | ConnectionImpl& operator=(const ConnectionImpl&&) = delete; |
| 58 | |
| 59 | ~ConnectionImpl() override |
| 60 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 61 | BMCWEB_LOG_DEBUG("SSE ConnectionImpl: SSE destructor {}", logPtr(this)); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | boost::asio::io_context& getIoContext() override |
| 65 | { |
| 66 | return static_cast<boost::asio::io_context&>( |
| 67 | adaptor.get_executor().context()); |
| 68 | } |
| 69 | |
| 70 | void start() |
| 71 | { |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 72 | if (!openHandler) |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 73 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 74 | BMCWEB_LOG_CRITICAL("No open handler???"); |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 75 | return; |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 76 | } |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 77 | openHandler(*this); |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 78 | sendSSEHeader(); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | void close(const std::string_view msg) override |
| 82 | { |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 83 | BMCWEB_LOG_DEBUG("Closing connection with reason {}", msg); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 84 | // send notification to handler for cleanup |
| 85 | if (closeHandler) |
| 86 | { |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 87 | closeHandler(*this); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 88 | } |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 89 | BMCWEB_LOG_DEBUG("Closing SSE connection {} - {}", logPtr(this), msg); |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 90 | boost::beast::get_lowest_layer(adaptor).close(); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 91 | } |
| 92 | |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 93 | void sendSSEHeader() |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 94 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 95 | BMCWEB_LOG_DEBUG("Starting SSE connection"); |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 96 | |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 97 | res.set(boost::beast::http::field::content_type, "text/event-stream"); |
Ed Tanous | 8ece0e4 | 2024-01-02 13:16:50 -0800 | [diff] [blame] | 98 | boost::beast::http::response_serializer<BodyType>& serial = |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 99 | serializer.emplace(res); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 100 | |
| 101 | boost::beast::http::async_write_header( |
Ed Tanous | 8ece0e4 | 2024-01-02 13:16:50 -0800 | [diff] [blame] | 102 | adaptor, serial, |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 103 | std::bind_front(&ConnectionImpl::sendSSEHeaderCallback, this, |
| 104 | shared_from_this())); |
| 105 | } |
| 106 | |
| 107 | void sendSSEHeaderCallback(const std::shared_ptr<Connection>& /*self*/, |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 108 | const boost::system::error_code& ec, |
| 109 | size_t /*bytesSent*/) |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 110 | { |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 111 | serializer.reset(); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 112 | if (ec) |
| 113 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 114 | BMCWEB_LOG_ERROR("Error sending header{}", ec); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 115 | close("async_write_header failed"); |
| 116 | return; |
| 117 | } |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 118 | BMCWEB_LOG_DEBUG("SSE header sent - Connection established"); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 119 | |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 120 | // SSE stream header sent, So let us setup monitor. |
| 121 | // Any read data on this stream will be error in case of SSE. |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 122 | adaptor.async_read_some(boost::asio::buffer(buffer), |
| 123 | std::bind_front(&ConnectionImpl::afterReadError, |
| 124 | this, shared_from_this())); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 125 | } |
| 126 | |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 127 | void afterReadError(const std::shared_ptr<Connection>& /*self*/, |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 128 | const boost::system::error_code& ec, size_t bytesRead) |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 129 | { |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 130 | BMCWEB_LOG_DEBUG("Read {}", bytesRead); |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 131 | if (ec == boost::asio::error::operation_aborted) |
| 132 | { |
| 133 | return; |
| 134 | } |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 135 | if (ec) |
| 136 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 137 | BMCWEB_LOG_ERROR("Read error: {}", ec); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 138 | } |
| 139 | |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 140 | close("Close SSE connection"); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | void doWrite() |
| 144 | { |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 145 | if (doingWrite) |
| 146 | { |
| 147 | return; |
| 148 | } |
| 149 | if (inputBuffer.size() == 0) |
| 150 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 151 | BMCWEB_LOG_DEBUG("inputBuffer is empty... Bailing out"); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 152 | return; |
| 153 | } |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 154 | startTimeout(); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 155 | doingWrite = true; |
| 156 | |
| 157 | adaptor.async_write_some( |
| 158 | inputBuffer.data(), |
| 159 | std::bind_front(&ConnectionImpl::doWriteCallback, this, |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 160 | shared_from_this())); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 161 | } |
| 162 | |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 163 | void doWriteCallback(const std::shared_ptr<Connection>& /*self*/, |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 164 | const boost::beast::error_code& ec, |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 165 | size_t bytesTransferred) |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 166 | { |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 167 | timer.cancel(); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 168 | doingWrite = false; |
| 169 | inputBuffer.consume(bytesTransferred); |
| 170 | |
| 171 | if (ec == boost::asio::error::eof) |
| 172 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 173 | BMCWEB_LOG_ERROR("async_write_some() SSE stream closed"); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 174 | close("SSE stream closed"); |
| 175 | return; |
| 176 | } |
| 177 | |
| 178 | if (ec) |
| 179 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 180 | BMCWEB_LOG_ERROR("async_write_some() failed: {}", ec.message()); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 181 | close("async_write_some failed"); |
| 182 | return; |
| 183 | } |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 184 | BMCWEB_LOG_DEBUG("async_write_some() bytes transferred: {}", |
| 185 | bytesTransferred); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 186 | |
| 187 | doWrite(); |
| 188 | } |
| 189 | |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 190 | void sendEvent(std::string_view id, std::string_view msg) override |
| 191 | { |
| 192 | if (msg.empty()) |
| 193 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 194 | BMCWEB_LOG_DEBUG("Empty data, bailing out."); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 195 | return; |
| 196 | } |
| 197 | |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 198 | dataFormat(id, msg); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 199 | |
| 200 | doWrite(); |
| 201 | } |
| 202 | |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 203 | void dataFormat(std::string_view id, std::string_view msg) |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 204 | { |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 205 | constexpr size_t bufferLimit = 10485760U; // 10MB |
| 206 | if (id.size() + msg.size() + inputBuffer.size() >= bufferLimit) |
| 207 | { |
| 208 | BMCWEB_LOG_ERROR("SSE Buffer overflow while waiting for client"); |
| 209 | close("Buffer overflow"); |
| 210 | return; |
| 211 | } |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 212 | std::string rawData; |
| 213 | if (!id.empty()) |
| 214 | { |
| 215 | rawData += "id: "; |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 216 | rawData.append(id); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 217 | rawData += "\n"; |
| 218 | } |
| 219 | |
| 220 | rawData += "data: "; |
| 221 | for (char character : msg) |
| 222 | { |
| 223 | rawData += character; |
| 224 | if (character == '\n') |
| 225 | { |
| 226 | rawData += "data: "; |
| 227 | } |
| 228 | } |
| 229 | rawData += "\n\n"; |
| 230 | |
Ed Tanous | 44106f3 | 2024-04-06 13:48:50 -0700 | [diff] [blame] | 231 | size_t copied = boost::asio::buffer_copy( |
| 232 | inputBuffer.prepare(rawData.size()), boost::asio::buffer(rawData)); |
| 233 | inputBuffer.commit(copied); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 234 | } |
| 235 | |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 236 | void startTimeout() |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 237 | { |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 238 | std::weak_ptr<Connection> weakSelf = weak_from_this(); |
| 239 | timer.expires_after(std::chrono::seconds(30)); |
| 240 | timer.async_wait(std::bind_front(&ConnectionImpl::onTimeoutCallback, |
| 241 | this, weak_from_this())); |
| 242 | } |
| 243 | |
| 244 | void onTimeoutCallback(const std::weak_ptr<Connection>& weakSelf, |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 245 | const boost::system::error_code& ec) |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 246 | { |
| 247 | std::shared_ptr<Connection> self = weakSelf.lock(); |
| 248 | if (!self) |
| 249 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 250 | BMCWEB_LOG_CRITICAL("{} Failed to capture connection", |
| 251 | logPtr(self.get())); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 252 | return; |
| 253 | } |
| 254 | |
| 255 | if (ec == boost::asio::error::operation_aborted) |
| 256 | { |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 257 | BMCWEB_LOG_DEBUG("Timer operation aborted"); |
Ed Tanous | 8ece0e4 | 2024-01-02 13:16:50 -0800 | [diff] [blame] | 258 | // Canceled wait means the path succeeded. |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 259 | return; |
| 260 | } |
| 261 | if (ec) |
| 262 | { |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 263 | BMCWEB_LOG_CRITICAL("{} timer failed {}", logPtr(self.get()), ec); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 264 | } |
| 265 | |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 266 | BMCWEB_LOG_WARNING("{} Connection timed out, closing", |
Ed Tanous | 62598e3 | 2023-07-17 17:06:25 -0700 | [diff] [blame] | 267 | logPtr(self.get())); |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 268 | |
| 269 | self->close("closing connection"); |
| 270 | } |
| 271 | |
| 272 | private: |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 273 | std::array<char, 1> buffer{}; |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 274 | boost::beast::multi_buffer inputBuffer; |
| 275 | |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 276 | Adaptor adaptor; |
| 277 | |
Ed Tanous | b289614 | 2024-01-31 15:25:47 -0800 | [diff] [blame] | 278 | using BodyType = bmcweb::HttpBody; |
Ed Tanous | 8f79c5b | 2024-01-30 15:56:37 -0800 | [diff] [blame] | 279 | boost::beast::http::response<BodyType> res; |
| 280 | std::optional<boost::beast::http::response_serializer<BodyType>> serializer; |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 281 | boost::asio::steady_timer timer; |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 282 | bool doingWrite = false; |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 283 | |
Ed Tanous | 6fde95f | 2023-06-01 07:33:34 -0700 | [diff] [blame] | 284 | std::function<void(Connection&)> openHandler; |
| 285 | std::function<void(Connection&)> closeHandler; |
V-Sanjana | 88ada3b | 2023-04-13 15:18:31 +0530 | [diff] [blame] | 286 | }; |
| 287 | } // namespace sse_socket |
| 288 | } // namespace crow |