Skip to content

Commit

Permalink
Remove httpclient max_simultaneous_connections argument.
Browse files Browse the repository at this point in the history
This argument doesn't do anything in modern versions of libcurl,
and is confusingly similar to max_clients.
  • Loading branch information
bdarnell committed Aug 11, 2012
1 parent 91b7c47 commit 6385cfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
9 changes: 3 additions & 6 deletions tornado/curl_httpclient.py
Expand Up @@ -34,14 +34,12 @@


class CurlAsyncHTTPClient(AsyncHTTPClient):
def initialize(self, io_loop=None, max_clients=10,
max_simultaneous_connections=None):
def initialize(self, io_loop=None, max_clients=10):
self.io_loop = io_loop
self._multi = pycurl.CurlMulti()
self._multi.setopt(pycurl.M_TIMERFUNCTION, self._set_timeout)
self._multi.setopt(pycurl.M_SOCKETFUNCTION, self._handle_socket)
self._curls = [_curl_create(max_simultaneous_connections)
for i in xrange(max_clients)]
self._curls = [_curl_create() for i in xrange(max_clients)]
self._free_list = self._curls[:]
self._requests = collections.deque()
self._fds = {}
Expand Down Expand Up @@ -263,12 +261,11 @@ def __init__(self, errno, message):
self.errno = errno


def _curl_create(max_simultaneous_connections=None):
def _curl_create():
curl = pycurl.Curl()
if logging.getLogger().isEnabledFor(logging.DEBUG):
curl.setopt(pycurl.VERBOSE, 1)
curl.setopt(pycurl.DEBUGFUNCTION, _curl_debug)
curl.setopt(pycurl.MAXCONNECTS, max_simultaneous_connections or 5)
return curl


Expand Down
10 changes: 4 additions & 6 deletions tornado/simple_httpclient.py
Expand Up @@ -61,19 +61,17 @@ class SimpleAsyncHTTPClient(AsyncHTTPClient):
"""
def initialize(self, io_loop=None, max_clients=10,
max_simultaneous_connections=None,
hostname_mapping=None, max_buffer_size=104857600):
"""Creates a AsyncHTTPClient.
Only a single AsyncHTTPClient instance exists per IOLoop
in order to provide limitations on the number of pending connections.
force_instance=True may be used to suppress this behavior.
max_clients is the number of concurrent requests that can be in
progress. max_simultaneous_connections has no effect and is accepted
only for compatibility with the curl-based AsyncHTTPClient. Note
that these arguments are only used when the client is first created,
and will be ignored when an existing client is reused.
max_clients is the number of concurrent requests that can be
in progress. Note that this arguments are only used when the
client is first created, and will be ignored when an existing
client is reused.
hostname_mapping is a dictionary mapping hostnames to IP addresses.
It can be used to make local DNS changes when modifying system-wide
Expand Down

0 comments on commit 6385cfa

Please sign in to comment.