diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llmediactrl.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llmediactrl.h | 4 | ||||
-rw-r--r-- | indra/newview/llpanellogin.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 77 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_about_land.xml | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_day_cycle_options.xml | 108 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_media_settings_security.xml | 7 |
8 files changed, 112 insertions, 118 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index f32866b1fe..199bd966ef 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -95,7 +95,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mHidingInitialLoad (false), mDecoupleTextureSize ( false ), mTextureWidth ( 1024 ), - mTextureHeight ( 1024 ) + mTextureHeight ( 1024 ), + mClearCache(false) { { LLColor4 color = p.caret_color().get(); @@ -491,6 +492,21 @@ void LLMediaCtrl::clr404RedirectUrl() //////////////////////////////////////////////////////////////////////////////// // +void LLMediaCtrl::clearCache() +{ + if(mMediaSource) + { + mMediaSource->clearCache(); + } + else + { + mClearCache = true; + } + +} + +//////////////////////////////////////////////////////////////////////////////// +// void LLMediaCtrl::navigateTo( std::string url_in, std::string mime_type) { // don't browse to anything that starts with secondlife:// or sl:// @@ -617,7 +633,12 @@ bool LLMediaCtrl::ensureMediaSourceExists() mMediaSource->setHomeURL(mHomePageUrl); mMediaSource->setVisible( getVisible() ); mMediaSource->addObserver( this ); - + if(mClearCache) + { + mMediaSource->clearCache(); + mClearCache = false; + } + if(mHideLoading) { mHidingInitialLoad = true; diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index f07513a3fd..8f9e6e7179 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -117,6 +117,9 @@ public: // set/clear URL to visit when a 404 page is reached void set404RedirectUrl( std::string redirect_url ); void clr404RedirectUrl(); + + // Clear the browser cache when the instance gets loaded + void clearCache(); // accessor/mutator for flag that indicates if frequent updates to texture happen bool getFrequentUpdates() { return mFrequentUpdates; }; @@ -192,6 +195,7 @@ public: bool mDecoupleTextureSize; S32 mTextureWidth; S32 mTextureHeight; + bool mClearCache; }; #endif // LL_LLMediaCtrl_H diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a9c604b72a..dbe962ed59 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -272,6 +272,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // get the web browser control LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html"); web_browser->addObserver(this); + + // Clear the browser's cache to avoid any potential for the cache messing up the login screen. + web_browser->clearCache(); // Need to handle login secondlife:///app/ URLs web_browser->setTrusted( true ); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 103a70e032..df62c9628d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -160,36 +160,25 @@ public: std::string media_type = content["content-type"].asString(); std::string::size_type idx1 = media_type.find_first_of(";"); std::string mime_type = media_type.substr(0, idx1); - completeAny(status, mime_type); - } - virtual void error( U32 status, const std::string& reason ) - { - if(status == 401) - { - // This is the "you need to authenticate" status. - // Treat this like an html page. - completeAny(status, "text/html"); - } - else - if(status == 403) - { - completeAny(status, "text/html"); - } - else - if(status == 404) - { - // 404 is content not found - sites often have bespoke 404 pages so - // treat them like an html page. - completeAny(status, "text/html"); - } - else - if(status == 406) + lldebugs << "status is " << status << ", media type \"" << media_type << "\"" << llendl; + + // 2xx status codes indicate success. + // Most 4xx status codes are successful enough for our purposes. + // 499 is the error code for host not found, timeout, etc. + if( ((status >= 200) && (status < 300)) || + ((status >= 400) && (status < 499)) ) { - // 406 means the server sent something that we didn't indicate was acceptable - // Eventually we should send what we accept in the headers but for now, - // treat 406s like an html page. - completeAny(status, "text/html"); + // The probe was successful. + + if(mime_type.empty()) + { + // Some sites don't return any content-type header at all. + // Treat an empty mime type as text/html. + mime_type = "text/html"; + } + + completeAny(status, mime_type); } else { @@ -200,6 +189,7 @@ public: mMediaImpl->mMediaSourceFailed = true; } } + } void completeAny(U32 status, const std::string& mime_type) @@ -582,8 +572,8 @@ bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &obj } else { - llinfos << "object interest = " << object_interest << ", lowest loadable = " << sLowestLoadableImplInterest << llendl; - if(object_interest > sLowestLoadableImplInterest) + lldebugs << "object interest = " << object_interest << ", lowest loadable = " << sLowestLoadableImplInterest << llendl; + if(object_interest >= sLowestLoadableImplInterest) result = true; } @@ -929,6 +919,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mMimeTypeProbe(NULL), mMediaAutoPlay(false), mInNearbyMediaList(false), + mClearCache(false), mIsUpdated(false) { @@ -1139,6 +1130,12 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent()); media_source->focus(mHasFocus); + if(mClearCache) + { + mClearCache = false; + media_source->clear_cache(); + } + mMediaSource = media_source; updateVolume(); @@ -1352,6 +1349,19 @@ std::string LLViewerMediaImpl::getCurrentMediaURL() } ////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::clearCache() +{ + if(mMediaSource) + { + mMediaSource->clear_cache(); + } + else + { + mClearCache = true; + } +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::mouseDown(S32 x, S32 y, MASK mask, S32 button) { scaleMouse(&x, &y); @@ -1633,7 +1643,12 @@ void LLViewerMediaImpl::navigateInternal() if(scheme.empty() || "http" == scheme || "https" == scheme) { - LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), 10.0f); + // If we don't set an Accept header, LLHTTPClient will add one like this: + // Accept: application/llsd+xml + // which is really not what we want. + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + LLHTTPClient::getHeaderOnly( mMediaURL, new LLMimeDiscoveryResponder(this), headers, 10.0f); } else if("data" == scheme || "file" == scheme || "about" == scheme) { diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 7151186089..28fb379960 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -188,6 +188,7 @@ public: std::string getCurrentMediaURL(); std::string getHomeURL() { return mHomeURL; } void setHomeURL(const std::string& home_url) { mHomeURL = home_url; }; + void clearCache(); std::string getMimeType() { return mMimeType; } void scaleMouse(S32 *mouse_x, S32 *mouse_y); void scaleTextureCoords(const LLVector2& texture_coords, S32 *x, S32 *y); @@ -355,6 +356,7 @@ public: bool mMediaAutoPlay; std::string mMediaEntryURL; bool mInNearbyMediaList; // used by LLFloaterNearbyMedia::refreshList() for performance reasons + bool mClearCache; private: BOOL mIsUpdated ; diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 1239152c32..a64716cb35 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1672,9 +1672,7 @@ Only large parcels can be listed in search. name="replace_texture_help" width="300" word_wrap="true"> - Objects using this texture will show the movie or web page after you click the play arrow. - -Select the thumbnail to choose a different texture. + Objects using this texture will show the movie or web page after you click the play arrow. Select the thumbnail to choose a different texture. </text> <check_box height="16" diff --git a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml index 35f3e643c3..8c5af2283d 100644 --- a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml +++ b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml @@ -65,11 +65,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL12am" follows="left|top|right" - height="6" + height="16" layout="topleft" left="8" name="WL12am" @@ -80,11 +78,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL3am" follows="left|top|right" - height="6" + height="16" layout="topleft" left_pad="10" name="WL3am" @@ -95,11 +91,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL6am" follows="left|top|right" - height="6" + height="16" layout="topleft" left_pad="10" name="WL6am" @@ -110,11 +104,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL9am" follows="left|top|right" - height="6" + height="16" layout="topleft" left_pad="10" name="WL9amHash" @@ -125,11 +117,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL12pm" follows="left|top|right" - height="6" + height="16" layout="topleft" left_pad="10" name="WL12pmHash" @@ -140,11 +130,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL3pm" follows="left|top|right" - height="6" + height="16" layout="topleft" left_pad="10" name="WL3pm" @@ -155,11 +143,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL6pm" follows="left|top|right" - height="6" + height="16" layout="topleft" left_pad="10" name="WL6pm" @@ -170,11 +156,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL9pm" follows="left|top|right" - height="6" + height="16" layout="topleft" left_pad="10" name="WL9pm" @@ -185,11 +169,9 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL12am2" follows="left|top|right" - height="6" + height="16" layout="topleft" left_pad="10" name="WL12am2" @@ -200,9 +182,7 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL12amHash" follows="left|top|right" font="SansSerif" height="14" @@ -210,135 +190,119 @@ left="20" name="WL12amHash" top="54" - width="4"> + width="6"> | </text> <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL3amHash" follows="left|top|right" font="SansSerif" height="11" layout="topleft" - left_pad="61" + left_pad="59" name="WL3amHash" top_delta="3" - width="4"> + width="6"> I </text> <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL6amHash" follows="left|top|right" font="SansSerif" height="14" layout="topleft" - left_pad="61" + left_pad="59" name="WL6amHash" top_delta="-3" - width="4"> + width="6"> | </text> <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL9amHash" follows="left|top|right" font="SansSerif" height="11" layout="topleft" - left_pad="61" + left_pad="59" name="WL9amHash2" top_delta="3" - width="4"> + width="6"> I </text> <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL12pmHash" follows="left|top|right" font="SansSerif" height="14" layout="topleft" - left_pad="61" + left_pad="59" name="WL12pmHash2" top_delta="-3" - width="4"> + width="6"> | </text> <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL3pmHash" follows="left|top|right" font="SansSerif" height="11" layout="topleft" - left_pad="61" + left_pad="59" name="WL3pmHash" top_delta="3" - width="4"> + width="6"> I </text> <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL6pmHash" follows="left|top|right" font="SansSerif" height="14" layout="topleft" - left_pad="61" + left_pad="59" name="WL6pmHash" top_delta="-3" - width="4"> + width="6"> | </text> <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL9pmHash" follows="left|top|right" font="SansSerif" height="11" layout="topleft" - left_pad="61" + left_pad="59" name="WL9pmHash" top_delta="3" - width="4"> + width="6"> I </text> <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WL12amHash2" follows="left|top|right" font="SansSerif" height="14" layout="topleft" - left_pad="61" + left_pad="59" name="WL12amHash2" top_delta="-3" - width="4"> + width="6"> | </text> <button @@ -346,9 +310,9 @@ label="Add Key" label_selected="Add Key" layout="topleft" - left="550" + left="555" name="WLAddKey" - top="20" + top="30" width="80" /> <button height="20" @@ -362,9 +326,7 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="DayCycleText" follows="left|top|right" font="SansSerif" height="16" @@ -378,9 +340,7 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="DayCycleText" follows="left|top|right" font="SansSerif" height="16" @@ -424,9 +384,7 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="WLCurKeyTimeText" follows="left|top|right" font="SansSerif" height="16" @@ -456,9 +414,7 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="DayCycleText" follows="left|top|right" font="SansSerif" height="16" @@ -481,9 +437,7 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="DayCycleText" follows="left|top|right" font="SansSerif" height="16" @@ -542,9 +496,7 @@ <text type="string" length="1" - bg_visible="true" border_visible="true" - control_name="DayCycleText" follows="left|top|right" font="SansSerif" height="16" @@ -560,7 +512,7 @@ label="Play" label_selected="Play" layout="topleft" - left_delta="0" + left_delta="60" name="WLAnimSky" top_pad="5" width="50" /> @@ -581,7 +533,7 @@ left_pad="5" name="WLUseLindenTime" top_delta="0" - width="140" /> + width="150" /> <button height="20" label="Save Test Day" diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_security.xml b/indra/newview/skins/default/xui/en/panel_media_settings_security.xml index 1f41a0d284..1f580831f9 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_security.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_security.xml @@ -17,7 +17,7 @@ font="SansSerifSmall" height="16" initial_value="false" - label="Only Allow Access to Specified URLs (by prefix)" + label="Only Allow Access to Specified URL patterns" left="10" mouse_opaque="true" name="whitelist_enable" @@ -81,10 +81,9 @@ height="40" left="30" text_color="0.6 0.0 0.0 1.0" + word_wrap="true" name="home_url_fails_whitelist"> -Warning: the home page specified in the General tab -fails to pass this whitelist. It has been disabled -until a valid entry has been added. +Warning: the home page specified in the General tab fails to pass this whitelist. It has been disabled until a valid entry has been added. </text> </panel> |