From 2efee058eaed1ca6f30b4dcda485bf2746619f71 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 12 Feb 2009 00:17:44 +0000 Subject: [PATCH] Major enhancement in comparison algorithm --- lib/request/comparison.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 8c5f3bd76..7b71a653d 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -79,11 +79,11 @@ def comparison(page, headers=None, getSeqMatcher=False): # If the url is stable and we did not set yet the match ratio and the # current injected value changes the url page content if MATCH_RATIO == None: - if conf.md5hash != None and ratio != 1: - logger.debug("Setting match ratio to %.3f" % ratio) + if conf.md5hash != None and ratio < 1 and ratio > 0.6: + logger.debug("setting match ratio to %.3f" % ratio) MATCH_RATIO = ratio - elif conf.md5hash == None: - logger.debug("Setting match ratio to default value 0.900") + elif conf.md5hash == None or ( conf.md5hash != None and ratio < 0.6 ): + logger.debug("setting match ratio to default value 0.900") MATCH_RATIO = 0.900 # If it has been requested to return the ratio and not a comparison