implementation of Feature #176 (Safe URL: avoid being kicked out after N unsuccessful requests)

This commit is contained in:
Miroslav Stampar
2010-04-16 12:44:47 +00:00
parent e11d511cad
commit 1aeaa5db47
5 changed files with 43 additions and 2 deletions

View File

@@ -299,7 +299,12 @@ class Connect:
ua = value
else:
ua = conf.parameters["User-Agent"]
if conf.safUrl and conf.saFreq > 0:
kb.queryCounter += 1
if kb.queryCounter % conf.saFreq == 0:
Connect.getPage(url=conf.safUrl, cookie=cookie, direct=True, silent=True, ua=ua)
page, headers = Connect.getPage(get=get, post=post, cookie=cookie, ua=ua, silent=silent)
if content: