From 8c6f7c7d5f088aa11b28413bc9a4160cc51eb416 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 15 Apr 2011 08:52:53 +0000 Subject: [PATCH] explicit usage of --time-sec will implicitly turn off auto-adjustment of time delay --- lib/core/common.py | 2 +- lib/core/option.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/core/common.py b/lib/core/common.py index febfacf0c..aca95f0c5 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1826,7 +1826,7 @@ def wasLastRequestDelayed(): lowerStdLimit = average(kb.responseTimes) + TIME_STDEV_COEFF * deviation retVal = (threadData.lastQueryDuration >= lowerStdLimit) - if not kb.testMode and retVal and conf.timeSec == TIME_DEFAULT_DELAY: + if not kb.testMode and retVal and kb.adjustTimeDelay: adjustTimeDelay(threadData.lastQueryDuration, lowerStdLimit) return retVal diff --git a/lib/core/option.py b/lib/core/option.py index 3782ffd94..aec83e1c0 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -89,6 +89,7 @@ from lib.core.settings import MAXDB_ALIASES from lib.core.settings import SYBASE_ALIASES from lib.core.settings import BURP_SPLITTER from lib.core.settings import MAX_NUMBER_OF_THREADS +from lib.core.settings import TIME_DEFAULT_DELAY from lib.core.settings import TIME_DELAY_CANDIDATES from lib.core.settings import UNKNOWN_DBMS_VERSION from lib.core.settings import WEBSCARAB_SPLITTER @@ -1196,6 +1197,8 @@ def __cleanupOptions(): if conf.data: conf.data = urldecode(conf.data) + kb.adjustTimeDelay = (conf.timeSec == TIME_DEFAULT_DELAY) + def __setConfAttributes(): """ This function set some needed attributes into the configuration @@ -1237,6 +1240,7 @@ def __setKnowledgeBaseAttributes(flushAll=True): logger.debug(debugMsg) kb.absFilePaths = set() + kb.adjustTimeDelay = False kb.authHeader = None kb.bannerFp = advancedDict()