diff options
| author | Don Kjer <don@lindenlab.com> | 2011-04-14 18:27:31 +0000 | 
|---|---|---|
| committer | Don Kjer <don@lindenlab.com> | 2011-04-14 18:27:31 +0000 | 
| commit | 01f4570c795b197e74bfa96139631c43df8d0664 (patch) | |
| tree | 7c1952cc51adec21025f537281e59f828e75224d /indra/newview/llcommandhandler.cpp | |
| parent | 2bf967149626672584b17b53fb5d2e6186f3d896 (diff) | |
| parent | 88a7262340f2fc5085f4ac6600790518d01292d6 (diff) | |
Merge with viewer-development
Diffstat (limited to 'indra/newview/llcommandhandler.cpp')
| -rwxr-xr-x | indra/newview/llcommandhandler.cpp | 17 | 
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 1b6ba02aac..19dba3f917 100755 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -35,7 +35,7 @@  // system includes  #include <boost/tokenizer.hpp> -#define THROTTLE_PERIOD    5    // required secs between throttled commands +#define THROTTLE_PERIOD    5    // required seconds 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,11 +122,19 @@ 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)  			{  				// 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)  				{ @@ -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);  | 
