From 7b56020d66d18145256752f9c8d66a20d02f960c Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 26 Jul 2013 18:49:31 -0700 Subject: ACME-755 Clear FB cookies by removing cookies from the .facebook.com domain --- indra/llplugin/llplugincookiestore.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/llplugin/llplugincookiestore.cpp') diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp index 82017ab3fa..9ccd3a655b 100755 --- a/indra/llplugin/llplugincookiestore.cpp +++ b/indra/llplugin/llplugincookiestore.cpp @@ -87,6 +87,16 @@ std::string LLPluginCookieStore::Cookie::getKey() const return result; } +std::string LLPluginCookieStore::Cookie::getDomain() const +{ + std::string result; + if(mDomainEnd > mDomainStart) + { + result += mCookie.substr(mDomainStart, mDomainEnd - mDomainStart); + } + return result; +} + bool LLPluginCookieStore::Cookie::parse(const std::string &host) { bool first_field = true; @@ -662,3 +672,19 @@ void LLPluginCookieStore::removeCookie(const std::string &key) } } +void LLPluginCookieStore::removeCookiesByDomain(const std::string &domain) +{ + cookie_map_t::iterator iter = mCookies.begin(); + while(iter != mCookies.end()) + { + if(iter->second->getDomain() == domain) + { + delete iter->second; + iter = mCookies.erase(iter); + } + else + { + ++iter; + } + } +} -- cgit v1.2.3 From bdd8005721c4030c91059a5b54c255648351a2f7 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 29 Jul 2013 12:09:29 -0700 Subject: ACME-755 : Fix erasing in live std::map (breaks build on Mac and Linux). --- indra/llplugin/llplugincookiestore.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/llplugin/llplugincookiestore.cpp') diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp index 9ccd3a655b..9f4d65e723 100755 --- a/indra/llplugin/llplugincookiestore.cpp +++ b/indra/llplugin/llplugincookiestore.cpp @@ -679,12 +679,14 @@ void LLPluginCookieStore::removeCookiesByDomain(const std::string &domain) { if(iter->second->getDomain() == domain) { - delete iter->second; - iter = mCookies.erase(iter); - } - else - { - ++iter; + cookie_map_t::iterator doErase = iter; + iter++; + delete doErase->second; + mCookies.erase(doErase); } + else + { + iter++; + } } } -- cgit v1.2.3