From: Ben Darnell Date: Sat, 11 Aug 2012 19:42:49 +0000 (-0700) Subject: Remove httpclient max_simultaneous_connections argument. X-Git-Tag: v2.4.0~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6385cfaa2b2c741082ea6ba82ebaf63db83bba78;p=thirdparty%2Ftornado.git Remove httpclient max_simultaneous_connections argument. This argument doesn't do anything in modern versions of libcurl, and is confusingly similar to max_clients. --- diff --git a/tornado/curl_httpclient.py b/tornado/curl_httpclient.py index 95958c19c..6017017be 100644 --- a/tornado/curl_httpclient.py +++ b/tornado/curl_httpclient.py @@ -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 diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py index c6e8a3a7c..e60a89f37 100644 --- a/tornado/simple_httpclient.py +++ b/tornado/simple_httpclient.py @@ -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