From d53055406ea82f57edc7d5f59ed73ca1cda90621 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 12 Jul 2021 20:32:48 +0300 Subject: DRTVWR-521 xcode buildfix --- indra/llplugin/llpluginprocessparent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 7d18bae947..e5b4dec1bd 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -154,9 +154,9 @@ void LLPluginProcessParent::shutdown() { EState state = (*it).second->mState; if (state != STATE_CLEANUP - || state != STATE_EXITING - || state != STATE_DONE - || state != STATE_ERROR) + && state != STATE_EXITING + && state != STATE_DONE + && state != STATE_ERROR) { (*it).second->setState(STATE_GOODBYE); } -- cgit v1.2.3 From b12dd38c57fd9b047382e6e2d80b26f36888eb39 Mon Sep 17 00:00:00 2001 From: Callum Linden Date: Thu, 26 Aug 2021 15:55:30 -0700 Subject: SL-15867 User not logged in - very much the MVS (minimum viable solution) but by storing the OpenID cookie when it arrives then injecting it forcefully into each new media instance, it appears that the 'not logged in' problem is solved - at least in my testing, 20+ times logging in without a cache and profiles, dashboard etc. were all logged in - QA will confirm. The full solution involves providing a separate cache for each media instance and tightening up the CEF cookie calling code - that is a large project and this is sufficient for now --- indra/llplugin/llpluginclassmedia.cpp | 60 +++++++++++++++++++++++++++++++++++ indra/llplugin/llpluginclassmedia.h | 14 ++++++++ 2 files changed, 74 insertions(+) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 6d51adc685..a436452461 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -690,6 +690,66 @@ bool LLPluginClassMedia::textInput(const std::string &text, MASK modifiers, LLSD return true; } +// This function injects a previously stored OpenID cookie into +// each new media instance - see SL-15867 for details. It appears +// that the way we use the cache, shared between multiple CEF +// instances means that sometimes the OpenID cookie cannot be read +// even though it appears to be there. The long term solution to +// this is to create a separate cache directory for each instance +// but that has its own set of problems. This short term approach +// "forces" each new media instance to have a copy of the cookie +// so that a page that needs it - e.g. Profiles - finds it and +// can log in successfully. +void LLPluginClassMedia::injectOpenIDCookie() +{ + // can be called before we know who the user is at login + // and there is no OpenID cookie at that point so no + // need to try to set it (these values will all be empty) + if (sOIDcookieName.length() && sOIDcookieValue.length()) + { + setCookie(sOIDcookieUrl, sOIDcookieName, + sOIDcookieValue, sOIDcookieHost, sOIDcookiePath, sOIDcookieHttpOnly, sOIDcookieSecure); + } +} + +// We store each component of the OpenI cookie individuality here +// because previously, there was some significant parsing to +// break up the raw string into these components and we do not +// want to have to do that again here. Stored as statics because +// we want to share their value between all instances of this +// class - the ones that receive it at login and any others +// that open afterwards (e.g. the Profiles floater) +std::string LLPluginClassMedia::sOIDcookieUrl = std::string(); +std::string LLPluginClassMedia::sOIDcookieName = std::string(); +std::string LLPluginClassMedia::sOIDcookieValue = std::string(); +std::string LLPluginClassMedia::sOIDcookieHost = std::string(); +std::string LLPluginClassMedia::sOIDcookiePath = std::string(); +bool LLPluginClassMedia::sOIDcookieHttpOnly = false; +bool LLPluginClassMedia::sOIDcookieSecure = false; + +// Once we receive the OpenID cookie, it is parsed/processed +// in llViewerMedia::parseRawCookie() and then the component +// values are stored here so that next time a new media +// instance is created, we can use injectOpenIDCookie() +// to "insist" that the cookie store remember its value. +// One might ask why we need to go via LLViewerMedia (which +// makes this call) - this is because the raw cookie arrives +// here in this file but undergoes non-trivial processing +// in LLViewerMedia. +void LLPluginClassMedia::storeOpenIDCookie(const std::string url, + const std::string name, const std::string value, + const std::string host, const std::string path, + bool httponly, bool secure) +{ + sOIDcookieUrl = url; + sOIDcookieName = name; + sOIDcookieValue = value; + sOIDcookieHost = host; + sOIDcookiePath = path; + sOIDcookieHttpOnly = httponly; + sOIDcookieSecure = secure; +} + void LLPluginClassMedia::setCookie(std::string uri, std::string name, std::string value, std::string domain, std::string path, bool httponly, bool secure) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_cookie"); diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 382f891e0c..a09145cf50 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -135,6 +135,20 @@ public: // Text may be unicode (utf8 encoded) bool textInput(const std::string &text, MASK modifiers, LLSD native_key_data); + static std::string sOIDcookieUrl; + static std::string sOIDcookieName; + static std::string sOIDcookieValue; + static std::string sOIDcookieHost; + static std::string sOIDcookiePath; + static bool sOIDcookieHttpOnly; + static bool sOIDcookieSecure; + void storeOpenIDCookie(const std::string url, + const std::string name, const std::string value, + const std::string host, const std::string path, + bool httponly, bool secure); + + void injectOpenIDCookie(); + void setCookie(std::string uri, std::string name, std::string value, std::string domain, std::string path, bool httponly, bool secure); void loadURI(const std::string &uri); -- cgit v1.2.3