]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Set proxy to '' if no proxy is explicitly set in the request.
authorvijayp <vijayp@jumo.com>
Thu, 18 Nov 2010 18:58:44 +0000 (13:58 -0500)
committervijayp <vijayp@jumo.com>
Thu, 18 Nov 2010 18:58:44 +0000 (13:58 -0500)
If this is not done, curls with proxies set are re-inserted into the empty list, and are then reused. This causes connections to be randomly proxied, if some requests use a proxy, and others don't.

tornado/httpclient.py

index 26e447cc90348a959425bf81ca3aa98e4e0eb0f7..3e04ff654958b6294bf5898f0b2ef81398d94728 100644 (file)
@@ -543,6 +543,8 @@ def _curl_setup_request(curl, request, buffer, headers):
             credentials = '%s:%s' % (request.proxy_username,
                     request.proxy_password)
             curl.setopt(pycurl.PROXYUSERPWD, credentials)
+    else:
+        curl.setopt(pycurl.PROXY, '')
 
     # Set the request method through curl's retarded interface which makes
     # up names for almost every single method