]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Remove httpclient max_simultaneous_connections argument.
authorBen Darnell <ben@bendarnell.com>
Sat, 11 Aug 2012 19:42:49 +0000 (12:42 -0700)
committerBen Darnell <ben@bendarnell.com>
Sat, 11 Aug 2012 19:42:49 +0000 (12:42 -0700)
This argument doesn't do anything in modern versions of libcurl,
and is confusingly similar to max_clients.

tornado/curl_httpclient.py
tornado/simple_httpclient.py

index 95958c19c16fa7f973bcca78bdfe10d81a8d3f80..6017017be36ec7931aea788480112c6ae6eb507b 100644 (file)
@@ -34,14 +34,12 @@ from tornado.httpclient import HTTPRequest, HTTPResponse, HTTPError, AsyncHTTPCl
 
 
 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 = {}
@@ -263,12 +261,11 @@ class CurlError(HTTPError):
         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
 
 
index c6e8a3a7ce0e0594d725cf5a09571651ab69b779..e60a89f3717088886f767deca75305d026e1d5f1 100644 (file)
@@ -61,7 +61,6 @@ 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.
 
@@ -69,11 +68,10 @@ class SimpleAsyncHTTPClient(AsyncHTTPClient):
         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