From 36b31c11bc6dea2e3a6a25b6e74df703afdfca7e Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Mon, 21 Mar 2011 00:15:28 +0100 Subject: several embedded browser proxy fixes and one small cookie fix * split xmlrpc and web browser proxy setting into 2 settings (because the login service might refuse to let you in using TOR) * fix web proxy to be used not only for the browser floater but also for login screen and parcel media. Backported for that the setProxyConfig method from Viewer-external(last gpl+floss version) * fix: no clear cookies button * todo: cookies need work note to devs of other viewers: if you find this useful feel free to apply my part to "lgpl v2.1 only" code without need to ask (thats all but setProxyConfig, which is anyway also released under lgpl by LL ). --- linden/indra/newview/llviewermedia.cpp | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'linden/indra/newview/llviewermedia.cpp') diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp index f0faedf..c228468 100644 --- a/linden/indra/newview/llviewermedia.cpp +++ b/linden/indra/newview/llviewermedia.cpp @@ -267,6 +267,23 @@ std::string LLViewerMedia::getCurrentUserAgent() return codec.str(); } + +///////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::setProxyConfig(bool enable, const std::string &host, int port) +{ + // Set the proxy config for all loaded plugins + impl_list::iterator iter = sViewerMediaImplList.begin(); + impl_list::iterator end = sViewerMediaImplList.end(); + for (; iter != end; iter++) + { + LLViewerMediaImpl* pimpl = *iter; + if(pimpl->mMediaSource) + { + pimpl->mMediaSource->proxy_setup(enable, host, port); + } + } +} ////////////////////////////////////////////////////////////////////////////////////////// // static @@ -395,6 +412,19 @@ LLViewerMediaImpl::~LLViewerMediaImpl() LLViewerMedia::removeMedia(this); } +//static +void LLViewerMediaImpl::setProxy(LLPluginClassMedia* media_source) +{ + // pass proxy settings to browser + bool proxy_enabled = gSavedSettings.getBOOL( "BrowserProxyEnabled" ); + std::string proxy_address = gSavedSettings.getString("BrowserProxyAddress"); + S32 proxy_port = gSavedSettings.getS32("BrowserProxyPort"); + media_source->proxy_setup(proxy_enabled, proxy_address, proxy_port); + LL_DEBUGS("Media") << "Proxy: " << (proxy_enabled ? "enabled" : "not enabled") + << " Address: " << proxy_address + << " Port: " << proxy_port << LL_ENDL; +} + ////////////////////////////////////////////////////////////////////////////////////////// bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) { @@ -411,6 +441,11 @@ bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) } } + if(mMediaSource) + { + setProxy(mMediaSource); + } + // play(); return (mMediaSource != NULL); } @@ -508,6 +543,8 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" ); media_source->setJavascriptEnabled( javascript_enabled ); + setProxy(media_source); + if (media_source->init(launcher_name, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))) { return media_source; @@ -741,6 +778,7 @@ void LLViewerMediaImpl::navigateHome() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type) { + if(rediscover_type) { -- cgit v1.1