From c23ea4c749958e4c8516f724b7242b2a5bde1bb3 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Thu, 10 Jun 2010 21:19:45 +0000 Subject: [PATCH] --keep-alive is not compatible with --proxy --- lib/core/option.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index d66135ae9..7d6c48b1a 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -96,7 +96,9 @@ def __urllib2Opener(): conf.cj = cookielib.LWPCookieJar() handlers.append(urllib2.HTTPCookieProcessor(conf.cj)) - if conf.keepAlive: + # Use Keep-Alive (persistent HTTP connection) only if a proxy is not set + # Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html + if conf.keepAlive and not conf.proxy: handlers.append(keepAliveHandler) opener = urllib2.build_opener(*handlers)