From 4295a78c5f2b697e723ed747763a52990b168079 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 10 Feb 2011 19:51:34 +0000 Subject: [PATCH] minor update --- lib/core/option.py | 4 ++++ lib/core/settings.py | 3 +++ lib/parse/cmdline.py | 3 +++ 3 files changed, 10 insertions(+) diff --git a/lib/core/option.py b/lib/core/option.py index 4da52bdaa..0448e118c 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -69,6 +69,7 @@ from lib.core.settings import IS_WIN from lib.core.settings import PLATFORM from lib.core.settings import PYVERSION from lib.core.settings import SITE +from lib.core.settings import DEFAULT_TOR_PROXY from lib.core.settings import SUPPORTED_DBMS from lib.core.settings import SUPPORTED_OS from lib.core.settings import VERSION_STRING @@ -1129,6 +1130,9 @@ def __cleanupOptions(): conf.nullConnection = not conf.textOnly conf.threads = 4 if conf.threads < 4 else conf.threads + if conf.tor: + conf.proxy = DEFAULT_TOR_PROXY + def __setConfAttributes(): """ This function set some needed attributes into the configuration diff --git a/lib/core/settings.py b/lib/core/settings.py index 69e3c6362..141b7a154 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -226,6 +226,9 @@ UNICODE_ENCODING = "utf8" # Reference: http://www.w3.org/Protocols/HTTP/Object_Headers.html#uri URI_HTTP_HEADER = "URI" +# Default Tor proxy settings +DEFAULT_TOR_PROXY = "http://127.0.0.1:8118" + # Uri format which could be injectable (e.g. www.site.com/id82) URI_INJECTABLE_REGEX = r".*/([^\.*?]+)\Z" diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index aa082a877..d813bc057 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -518,6 +518,9 @@ def cmdLineParser(): parser.add_option("--technique", dest="technique", type="int", default=0, help=SUPPRESS_HELP) + parser.add_option("--tor", dest="tor", action="store_true", + default=False, help=SUPPRESS_HELP) + parser.add_option_group(target) parser.add_option_group(request) parser.add_option_group(optimization)