Skip to content

Commit

Permalink
Set proxy to '' if no proxy is explicitly set in the request.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vijayp committed Nov 18, 2010
1 parent 160c961 commit 905a215
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tornado/httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 905a215

Please sign in to comment.