conf.md5hash thrown out

This commit is contained in:
Miroslav Stampar
2010-10-25 13:52:21 +00:00
parent 9a3879feba
commit 9c94a233a1
4 changed files with 9 additions and 17 deletions

View File

@@ -77,11 +77,11 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
if conf.thold:
conf.matchRatio = conf.thold
elif conf.md5hash is not None and ratio > 0.6 and ratio < 1:
elif kb.pageStable and ratio > 0.6 and ratio < 1:
logger.debug("setting match ratio to %.3f" % ratio)
conf.matchRatio = ratio
elif conf.md5hash is None or ( conf.md5hash is not None and ratio < 0.6 ):
elif not kb.pageStable or ( kb.pageStable and ratio < 0.6 ):
logger.debug("setting match ratio to default value 0.900")
conf.matchRatio = 0.900
@@ -93,13 +93,6 @@ def comparison(page, headers=None, getSeqMatcher=False, pageLength=None):
if getSeqMatcher:
return ratio
# If the url is stable it returns True if the page has the same MD5
# hash of the original one
# NOTE: old implementation, it did not handle automatically the fact
# that the url could be not stable (due to VIEWSTATE, counter, etc.)
#elif conf.md5hash is not None:
# return conf.md5hash == md5hash(page)
# In case of an DBMS error page return False
elif conf.errorComparison and kb.lastErrorPage and kb.lastErrorPage[0]==kb.lastRequestUID:
return False