diff options
author | Ed Tanous <edtanous@google.com> | 2023-06-01 17:33:34 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-06-01 23:43:11 +0300 |
commit | 6fde95fad082fa7d6fc54f2ef8584e06fb116d42 (patch) | |
tree | 31865ca598fcb00af96d5d33824cf53ae1df4f36 /include/http_utility.hpp | |
parent | 88ada3bc05ea247b6c8a24db49ebfdd268c17f4d (diff) | |
download | bmcweb-6fde95fad082fa7d6fc54f2ef8584e06fb116d42.tar.xz |
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 <edtanous@google.com>
Change-Id: Id0ff0ebc2b3a795b3dba008e440556a9fdd882c2
Diffstat (limited to 'include/http_utility.hpp')
-rw-r--r-- | include/http_utility.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
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<ContentTypePair, 4> contentTypes{{ +constexpr std::array<ContentTypePair, 5> 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 |