From 6fde95fad082fa7d6fc54f2ef8584e06fb116d42 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 1 Jun 2023 07:33:34 -0700 Subject: Server-sent-event fixes This makes several changes to server-sent events to allow it to merge to master. The routing system has been removed in leiu of using content-type eventstream detection. Timers have been added to the sse connections, and sse connections now rely on async_wait, rather than a full read. Tested: WIP Signed-off-by: Ed Tanous Change-Id: Id0ff0ebc2b3a795b3dba008e440556a9fdd882c2 --- include/http_utility.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/http_utility.hpp b/include/http_utility.hpp index 8f2478fcd2..d18ac4bdf5 100644 --- a/include/http_utility.hpp +++ b/include/http_utility.hpp @@ -26,6 +26,7 @@ enum class ContentType HTML, JSON, OctetStream, + EventStream, }; struct ContentTypePair @@ -34,11 +35,12 @@ struct ContentTypePair ContentType contentTypeEnum; }; -constexpr std::array contentTypes{{ +constexpr std::array contentTypes{{ {"application/cbor", ContentType::CBOR}, {"application/json", ContentType::JSON}, {"application/octet-stream", ContentType::OctetStream}, {"text/html", ContentType::HTML}, + {"text/event-stream", ContentType::EventStream}, }}; inline ContentType -- cgit v1.2.3