aboutsummaryrefslogtreecommitdiff
path: root/zencore/session.cpp
diff options
context:
space:
mode:
authorPer Larsson <[email protected]>2021-09-20 08:54:34 +0200
committerPer Larsson <[email protected]>2021-09-20 08:54:34 +0200
commite25b4b20d8a5696aa7055c9c167fa47b3739bc7e (patch)
tree049654b87096a22e1bf696a385db608a75f229fa /zencore/session.cpp
parentProbe upstream Zen server when initializing upstream cache. (diff)
parentFixed unused variable warnings exposed by xmake build (unclear why I do not r... (diff)
downloadzen-e25b4b20d8a5696aa7055c9c167fa47b3739bc7e.tar.xz
zen-e25b4b20d8a5696aa7055c9c167fa47b3739bc7e.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zencore/session.cpp')
-rw-r--r--zencore/session.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/zencore/session.cpp b/zencore/session.cpp
index d57d3685b..ce4bfae1b 100644
--- a/zencore/session.cpp
+++ b/zencore/session.cpp
@@ -9,14 +9,27 @@
namespace zen {
static Oid GlobalSessionId;
+static char GlobalSessionString[Oid::StringLength];
static std::once_flag SessionInitFlag;
Oid
GetSessionId()
{
- std::call_once(SessionInitFlag, [&] { GlobalSessionId.Generate(); });
+ std::call_once(SessionInitFlag, [&] {
+ GlobalSessionId.Generate();
+ GlobalSessionId.ToString(GlobalSessionString);
+ });
return GlobalSessionId;
}
+std::string_view
+GetSessionIdString()
+{
+ // Ensure we actually have a generated session identifier
+ std::ignore = GetSessionId();
+
+ return std::string_view(GlobalSessionString, Oid::StringLength);
+}
+
} // namespace zen \ No newline at end of file