diff options
author | Armin Weatherwax | 2011-03-21 00:15:28 +0100 |
---|---|---|
committer | Armin Weatherwax | 2011-03-21 00:15:28 +0100 |
commit | 36b31c11bc6dea2e3a6a25b6e74df703afdfca7e (patch) | |
tree | b071649e89750e964612e0285da355d90ce335d6 /linden/indra/newview/llviewermedia.cpp | |
parent | fix: voice always on, even if told not to be (diff) | |
download | meta-impy-36b31c11bc6dea2e3a6a25b6e74df703afdfca7e.zip meta-impy-36b31c11bc6dea2e3a6a25b6e74df703afdfca7e.tar.gz meta-impy-36b31c11bc6dea2e3a6a25b6e74df703afdfca7e.tar.bz2 meta-impy-36b31c11bc6dea2e3a6a25b6e74df703afdfca7e.tar.xz |
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 ).
Diffstat (limited to 'linden/indra/newview/llviewermedia.cpp')
-rw-r--r-- | linden/indra/newview/llviewermedia.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
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() | |||
267 | 267 | ||
268 | return codec.str(); | 268 | return codec.str(); |
269 | } | 269 | } |
270 | |||
271 | ///////////////////////////////////////////////////////////////////////////////////////// | ||
272 | // static | ||
273 | void LLViewerMedia::setProxyConfig(bool enable, const std::string &host, int port) | ||
274 | { | ||
275 | // Set the proxy config for all loaded plugins | ||
276 | impl_list::iterator iter = sViewerMediaImplList.begin(); | ||
277 | impl_list::iterator end = sViewerMediaImplList.end(); | ||
278 | for (; iter != end; iter++) | ||
279 | { | ||
280 | LLViewerMediaImpl* pimpl = *iter; | ||
281 | if(pimpl->mMediaSource) | ||
282 | { | ||
283 | pimpl->mMediaSource->proxy_setup(enable, host, port); | ||
284 | } | ||
285 | } | ||
286 | } | ||
270 | 287 | ||
271 | ////////////////////////////////////////////////////////////////////////////////////////// | 288 | ////////////////////////////////////////////////////////////////////////////////////////// |
272 | // static | 289 | // static |
@@ -395,6 +412,19 @@ LLViewerMediaImpl::~LLViewerMediaImpl() | |||
395 | LLViewerMedia::removeMedia(this); | 412 | LLViewerMedia::removeMedia(this); |
396 | } | 413 | } |
397 | 414 | ||
415 | //static | ||
416 | void LLViewerMediaImpl::setProxy(LLPluginClassMedia* media_source) | ||
417 | { | ||
418 | // pass proxy settings to browser | ||
419 | bool proxy_enabled = gSavedSettings.getBOOL( "BrowserProxyEnabled" ); | ||
420 | std::string proxy_address = gSavedSettings.getString("BrowserProxyAddress"); | ||
421 | S32 proxy_port = gSavedSettings.getS32("BrowserProxyPort"); | ||
422 | media_source->proxy_setup(proxy_enabled, proxy_address, proxy_port); | ||
423 | LL_DEBUGS("Media") << "Proxy: " << (proxy_enabled ? "enabled" : "not enabled") | ||
424 | << " Address: " << proxy_address | ||
425 | << " Port: " << proxy_port << LL_ENDL; | ||
426 | } | ||
427 | |||
398 | ////////////////////////////////////////////////////////////////////////////////////////// | 428 | ////////////////////////////////////////////////////////////////////////////////////////// |
399 | bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) | 429 | bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) |
400 | { | 430 | { |
@@ -411,6 +441,11 @@ bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) | |||
411 | } | 441 | } |
412 | } | 442 | } |
413 | 443 | ||
444 | if(mMediaSource) | ||
445 | { | ||
446 | setProxy(mMediaSource); | ||
447 | } | ||
448 | |||
414 | // play(); | 449 | // play(); |
415 | return (mMediaSource != NULL); | 450 | return (mMediaSource != NULL); |
416 | } | 451 | } |
@@ -508,6 +543,8 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ | |||
508 | bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" ); | 543 | bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" ); |
509 | media_source->setJavascriptEnabled( javascript_enabled ); | 544 | media_source->setJavascriptEnabled( javascript_enabled ); |
510 | 545 | ||
546 | setProxy(media_source); | ||
547 | |||
511 | if (media_source->init(launcher_name, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))) | 548 | if (media_source->init(launcher_name, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))) |
512 | { | 549 | { |
513 | return media_source; | 550 | return media_source; |
@@ -741,6 +778,7 @@ void LLViewerMediaImpl::navigateHome() | |||
741 | ////////////////////////////////////////////////////////////////////////////////////////// | 778 | ////////////////////////////////////////////////////////////////////////////////////////// |
742 | void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type) | 779 | void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type) |
743 | { | 780 | { |
781 | |||
744 | if(rediscover_type) | 782 | if(rediscover_type) |
745 | { | 783 | { |
746 | 784 | ||