Finishing implementation for an Issue #58

This commit is contained in:
Miroslav Stampar 2013-08-20 19:35:49 +02:00
parent c586559e30
commit 23f2c5f166
3 changed files with 9 additions and 7 deletions

View File

@ -2246,9 +2246,6 @@ def logHTTPTraffic(requestLogMsg, responseLogMsg):
def getPageTemplate(payload, place): # Cross-linked function
raise NotImplementedError
def setHTTPProxy(): # Cross-linked function
raise NotImplementedError
def getPublicTypeMembers(type_, onlyValues=False):
"""
Useful for getting members from types (e.g. in enums)

View File

@ -22,6 +22,7 @@ import urlparse
import lib.core.common
import lib.core.threads
import lib.core.convert
import lib.request.connect
from lib.controller.checks import checkConnection
from lib.core.common import Backend
@ -985,6 +986,9 @@ def _setHTTPProxy():
if conf.proxyList:
conf.proxy = conf.proxyList[0]
conf.proxyList = conf.proxyList[1:] + conf.proxyList[:1]
infoMsg = "loading proxy '%s' from a supplied proxy list file" % conf.proxy
logger.info(infoMsg)
else:
if conf.hostname in ('localhost', '127.0.0.1') or conf.ignoreProxy:
proxyHandler.proxies = {}
@ -2172,8 +2176,8 @@ def _basicOptionValidation():
def _resolveCrossReferences():
lib.core.threads.readInput = readInput
lib.core.common.getPageTemplate = getPageTemplate
lib.core.common.setHTTPProxy = _setHTTPProxy
lib.core.convert.singleTimeWarnMessage = singleTimeWarnMessage
lib.request.connect.setHTTPProxy = _setHTTPProxy
def initOptions(inputOptions=AttribDict(), overrideOptions=False):
if not inputOptions.disableColoring:

View File

@ -37,7 +37,6 @@ from lib.core.common import randomInt
from lib.core.common import randomStr
from lib.core.common import readInput
from lib.core.common import removeReflectiveValues
from lib.core.common import setHTTPProxy
from lib.core.common import singleTimeLogMessage
from lib.core.common import singleTimeWarnMessage
from lib.core.common import stdev
@ -112,8 +111,7 @@ class Connect(object):
warnMsg = "changing proxy"
logger.warn(warnMsg)
conf.proxy = conf.proxyList[0]
conf.proxyList = conf.proxyList[1:] + conf.proxyList[:1]
conf.proxy = None
setHTTPProxy()
if kb.testMode and kb.previousMethod == PAYLOAD.METHOD.TIME:
@ -900,3 +898,6 @@ class Connect(object):
return comparison(page, headers, code, getRatioValue=False, pageLength=pageLength), comparison(page, headers, code, getRatioValue=True, pageLength=pageLength)
else:
return comparison(page, headers, code, getRatioValue, pageLength)
def setHTTPProxy(): # Cross-linked function
raise NotImplementedError