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.
This commit is contained in:
vijayp 2010-11-18 13:58:44 -05:00
parent 160c961fe1
commit 905a215a28
1 changed files with 2 additions and 0 deletions

View 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