From b286a9091b66c816f12e9a98e5ae092549261904 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 25 Mar 2011 13:56:14 -0700 Subject: SOCIAL-688 FIX Multiple SLurls error given in minimal skin when clicking links in web profile Also fixes SOCIAL-521 and SOCIAL-428 --- indra/newview/llcommandhandler.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'indra/newview/llcommandhandler.cpp') diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 1b6ba02aac..bb1fb41fae 100755 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -35,7 +35,7 @@ // system includes #include -#define THROTTLE_PERIOD 5 // required secs between throttled commands +#define THROTTLE_PERIOD 20 // required secs between throttled commands static LLCommandDispatcherListener sCommandDispatcherListener; @@ -59,6 +59,7 @@ public: const LLSD& params, const LLSD& query_map, LLMediaCtrl* web, + const std::string& nav_type, bool trusted_browser); private: @@ -91,6 +92,7 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, const LLSD& params, const LLSD& query_map, LLMediaCtrl* web, + const std::string& nav_type, bool trusted_browser) { static bool slurl_blocked = false; @@ -120,6 +122,14 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, return true; case LLCommandHandler::UNTRUSTED_THROTTLE: + // if users actually click on a link, we don't need to throttle it + // (throttling mechanism is used to prevent an avalanche of clicks via + // javascript + if ( nav_type == "clicked" ) + { + break; + } + cur_time = LLTimer::getElapsedSeconds(); if (cur_time < last_throttle_time + THROTTLE_PERIOD) { @@ -166,10 +176,11 @@ bool LLCommandDispatcher::dispatch(const std::string& cmd, const LLSD& params, const LLSD& query_map, LLMediaCtrl* web, + const std::string& nav_type, bool trusted_browser) { return LLCommandHandlerRegistry::instance().dispatch( - cmd, params, query_map, web, trusted_browser); + cmd, params, query_map, web, nav_type, trusted_browser); } static std::string lookup(LLCommandHandler::EUntrustedAccess value); -- cgit v1.2.3 From bdef5609828a06b50ceadf61f56ac2d31e9b7f43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 7 Apr 2011 16:20:26 -0700 Subject: SOCIAL-688 FIX Multiple SLurls error given in minimal skin when clicking links in web profile reverted throttling of untrusted slapps to 1 every 5 seconds don't treat slapps originating from external browsers as clicks and thus bypassing throttling --- indra/newview/llcommandhandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llcommandhandler.cpp') diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index bb1fb41fae..19dba3f917 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -35,7 +35,7 @@ // system includes #include -#define THROTTLE_PERIOD 20 // required secs between throttled commands +#define THROTTLE_PERIOD 5 // required seconds between throttled commands static LLCommandDispatcherListener sCommandDispatcherListener; @@ -134,7 +134,7 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, if (cur_time < last_throttle_time + THROTTLE_PERIOD) { // block request from external browser if it happened - // within THROTTLE_PERIOD secs of the last command + // within THROTTLE_PERIOD seconds of the last command LL_WARNS_ONCE("SLURL") << "Throttled SLURL command from untrusted browser" << LL_ENDL; if (! slurl_throttled) { -- cgit v1.2.3