diff options
author | James Cook <james@lindenlab.com> | 2009-12-11 10:22:50 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-12-11 10:22:50 -0800 |
commit | a87b99cd950de20dc55e1ae6ce7186863a554326 (patch) | |
tree | 43d1385397cbefac07934588824a3d0716fc6365 /indra/newview/llcommandhandler.cpp | |
parent | b26694f2ab4d88fb8a0e4b1f0e8733f111af4522 (diff) | |
parent | c74d5c483cbd75c5e2a0b17c8980755a9932c53a (diff) |
Merge, fixed conflict in panel_preferences_sound.xml
Diffstat (limited to 'indra/newview/llcommandhandler.cpp')
-rw-r--r-- | indra/newview/llcommandhandler.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index af6488388a..8c7e7bea83 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -34,12 +34,16 @@ #include "llviewerprecompiledheaders.h" #include "llcommandhandler.h" +#include "llnotificationsutil.h" +#include "llcommanddispatcherlistener.h" // system includes #include <boost/tokenizer.hpp> #define THROTTLE_PERIOD 15 // required secs between throttled commands +static LLCommandDispatcherListener sCommandDispatcherListener; + //--------------------------------------------------------------------------- // Underlying registry for command handlers, not directly accessible. //--------------------------------------------------------------------------- @@ -93,6 +97,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<std::string, LLCommandHandlerInfo>::iterator it = mMap.find(cmd); @@ -110,6 +116,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 +130,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; |