Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c23ea4c

Browse files
committed
--keep-alive is not compatible with --proxy
1 parent 2835ad6 commit c23ea4c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/core/option.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def __urllib2Opener():
9696
conf.cj = cookielib.LWPCookieJar()
9797
handlers.append(urllib2.HTTPCookieProcessor(conf.cj))
9898

99-
if conf.keepAlive:
99+
# Use Keep-Alive (persistent HTTP connection) only if a proxy is not set
100+
# Reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html
101+
if conf.keepAlive and not conf.proxy:
100102
handlers.append(keepAliveHandler)
101103

102104
opener = urllib2.build_opener(*handlers)

0 commit comments

Comments
 (0)