From ea8a3eb65345e98abe129e35ada861920d68e3c7 Mon Sep 17 00:00:00 2001 From: "morgamic%mozilla.com" Date: Tue, 24 Jul 2007 01:37:42 +0000 Subject: [PATCH] Checking in rewriterule [QSA] to append query string. Adding check for force=1. Both changes from bug 388592. git-svn-id: svn://10.0.0.236/trunk@230715 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/aus/xml/htaccess.dist | 4 ++-- mozilla/webtools/aus/xml/index.php | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/mozilla/webtools/aus/xml/htaccess.dist b/mozilla/webtools/aus/xml/htaccess.dist index 9af9717560f..e7b3da0ad1c 100644 --- a/mozilla/webtools/aus/xml/htaccess.dist +++ b/mozilla/webtools/aus/xml/htaccess.dist @@ -2,7 +2,7 @@ # TODO: Then use PHP to parse path using pathinfo() instead. RewriteEngine On RewriteBase /~morgamic/aus -RewriteRule ^update2/(.*)$ index.php?path=$1 -RewriteRule ^update/(.*)$ index.php?path=$1 +RewriteRule ^update2/(.*)$ index.php?path=$1 [QSA] +RewriteRule ^update/(.*)$ index.php?path=$1 [QSA] php_value error_reporting 2047 php_value display_errors 1 diff --git a/mozilla/webtools/aus/xml/index.php b/mozilla/webtools/aus/xml/index.php index f51fd4a41a9..d0c11d43078 100644 --- a/mozilla/webtools/aus/xml/index.php +++ b/mozilla/webtools/aus/xml/index.php @@ -53,9 +53,14 @@ require_once('./inc/init.php'); // Instantiate XML object. $xml = new Xml(); -// Before we get started check throttle and see if we want to randomly serve an -// update for this request. -if (defined('THROTTLE') && THROTTLE && defined('THROTTLE_LEVEL') && mt_rand(0,100) > THROTTLE_LEVEL) { +// Check to see if the user is explicitly requesting an update. If they are, +// skip throttling. If they aren't, and throttling is enabled, randomly serve +// updates based on the configured random seed. +if ( $_GET['force']!=1 && + defined('THROTTLE') && + THROTTLE && + defined('THROTTLE_LEVEL') && + mt_rand(0,100) > THROTTLE_LEVEL ) { if (defined('THROTTLE_LOGGING') && THROTTLE_LOGGING) {