From: vijayp Date: Thu, 18 Nov 2010 18:58:44 +0000 (-0500) Subject: Set proxy to '' if no proxy is explicitly set in the request. X-Git-Tag: v1.2.0~70^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=905a215a286041c986005859c378c0445c127cbb;p=thirdparty%2Ftornado.git Set proxy to '' if no proxy is explicitly set in the request. 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. --- diff --git a/tornado/httpclient.py b/tornado/httpclient.py index 26e447cc9..3e04ff654 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -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