From 363ee42d53bd3049df0d17f16e211fac6b73daf7 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 9 Dec 2009 18:44:01 +0000 Subject: EXT-3234: Display notification when SLurl blocked/throttled. We block or throttled certain SLurls when they came from an untrusted browser. Previously this would happen silently (though a message was sent to the logfile). Now we show a once-per-session notification if either of these situations arise. --- indra/newview/llcommandhandler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llcommandhandler.cpp') diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index af6488388a..1d92661ea2 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -34,6 +34,7 @@ #include "llviewerprecompiledheaders.h" #include "llcommandhandler.h" +#include "llnotificationsutil.h" // system includes #include @@ -93,6 +94,8 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, LLMediaCtrl* web, bool trusted_browser) { + static bool slurl_blocked = false; + static bool slurl_throttled = false; static F64 last_throttle_time = 0.0; F64 cur_time = 0.0; std::map::iterator it = mMap.find(cmd); @@ -110,6 +113,11 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, // block request from external browser, but report as // "handled" because it was well formatted. LL_WARNS_ONCE("SLURL") << "Blocked SLURL command from untrusted browser" << LL_ENDL; + if (! slurl_blocked) + { + LLNotificationsUtil::add("BlockedSLURL"); + slurl_blocked = true; + } return true; case LLCommandHandler::UNTRUSTED_THROTTLE: @@ -119,6 +127,11 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, // block request from external browser if it happened // within THROTTLE_PERIOD secs of the last command LL_WARNS_ONCE("SLURL") << "Throttled SLURL command from untrusted browser" << LL_ENDL; + if (! slurl_throttled) + { + LLNotificationsUtil::add("ThrottledSLURL"); + slurl_throttled = true; + } return true; } last_throttle_time = cur_time; -- cgit v1.2.3 From 19122e164ca2a3c1616619b220118344b1858cc8 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 10 Dec 2009 22:30:57 -0500 Subject: Add LL(URLDispatcher,CommandDispatcher,PanelLogin)Listener LLURLDispatcherListener accepts requests for LLURLDispatcher. LLCommandDispatcherListener accepts requests for LLCommandDispatcher. LLPanelLoginListener accepts requests specifically for LLPanelLogin. Initially it supports a simulated click to the "Log In" button. --- indra/newview/llcommandhandler.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llcommandhandler.cpp') diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 1d92661ea2..8c7e7bea83 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -35,12 +35,15 @@ #include "llcommandhandler.h" #include "llnotificationsutil.h" +#include "llcommanddispatcherlistener.h" // system includes #include #define THROTTLE_PERIOD 15 // required secs between throttled commands +static LLCommandDispatcherListener sCommandDispatcherListener; + //--------------------------------------------------------------------------- // Underlying registry for command handlers, not directly accessible. //--------------------------------------------------------------------------- -- cgit v1.2.3