summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-08-24 19:22:00 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-08-24 19:22:00 +0100
commite416840f85dc4a367894036b9fe483f17d959c54 (patch)
treee12956cbe7a0082bbaaa545cb80d9e86b13f88e8 /indra/newview/llviewermedia.cpp
parent98cc2365034a93c69704daa69efb389799cc9627 (diff)
Backed out changeset c3d41f18ce2b
back-out the back-out for this branch. yay.
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp42
1 files changed, 35 insertions, 7 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 47a98ff888..283669aaef 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -50,6 +50,7 @@
#include "llvoavatar.h"
#include "llvoavatarself.h"
#include "llviewerregion.h"
+#include "llwebsharing.h" // For LLWebSharing::setOpenIDCookie(), *TODO: find a better way to do this!
#include "llevent.h" // LLSimpleListener
#include "llnotificationsutil.h"
@@ -1312,6 +1313,9 @@ void LLViewerMedia::setOpenIDCookie()
}
getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start));
+
+ // *HACK: Doing this here is nasty, find a better way.
+ LLWebSharing::instance().setOpenIDCookie(sOpenIDCookie);
}
}
@@ -2186,7 +2190,8 @@ void LLViewerMediaImpl::navigateReload()
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::navigateHome()
{
- navigateTo(mHomeURL, "", true, false);
+ bool rediscover_mimetype = mHomeMimeType.empty();
+ navigateTo(mHomeURL, mHomeMimeType, rediscover_mimetype, false);
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -2298,6 +2303,8 @@ void LLViewerMediaImpl::navigateInternal()
// which is really not what we want.
LLSD headers = LLSD::emptyMap();
headers["Accept"] = "*/*";
+ // Allow cookies in the response, to prevent a redirect loop when accessing join.secondlife.com
+ headers["Cookie"] = "";
LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), headers, 10.0f);
}
else if("data" == scheme || "file" == scheme || "about" == scheme)
@@ -2906,14 +2913,23 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
{
LL_DEBUGS("Media") << "MEDIA_EVENT_NAVIGATE_COMPLETE, uri is: " << plugin->getNavigateURI() << LL_ENDL;
+ std::string url = plugin->getNavigateURI();
if(getNavState() == MEDIANAVSTATE_BEGUN)
{
- mCurrentMediaURL = plugin->getNavigateURI();
- setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED);
+ if(mCurrentMediaURL == url)
+ {
+ // This is a navigate that takes us to the same url as the previous navigate.
+ setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS);
+ }
+ else
+ {
+ mCurrentMediaURL = url;
+ setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED);
+ }
}
else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN)
{
- mCurrentMediaURL = plugin->getNavigateURI();
+ mCurrentMediaURL = url;
setNavState(MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED);
}
else
@@ -2927,14 +2943,24 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
{
LL_DEBUGS("Media") << "MEDIA_EVENT_LOCATION_CHANGED, uri is: " << plugin->getLocation() << LL_ENDL;
+ std::string url = plugin->getLocation();
+
if(getNavState() == MEDIANAVSTATE_BEGUN)
{
- mCurrentMediaURL = plugin->getLocation();
- setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED);
+ if(mCurrentMediaURL == url)
+ {
+ // This is a navigate that takes us to the same url as the previous navigate.
+ setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS);
+ }
+ else
+ {
+ mCurrentMediaURL = url;
+ setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED);
+ }
}
else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN)
{
- mCurrentMediaURL = plugin->getLocation();
+ mCurrentMediaURL = url;
setNavState(MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED);
}
else
@@ -3218,7 +3244,9 @@ void LLViewerMediaImpl::setNavState(EMediaNavState state)
case MEDIANAVSTATE_NONE: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_NONE" << llendl; break;
case MEDIANAVSTATE_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_BEGUN" << llendl; break;
case MEDIANAVSTATE_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED" << llendl; break;
+ case MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS" << llendl; break;
case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED" << llendl; break;
+ case MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS" << llendl; break;
case MEDIANAVSTATE_SERVER_SENT: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_SENT" << llendl; break;
case MEDIANAVSTATE_SERVER_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_BEGUN" << llendl; break;
case MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED" << llendl; break;