diff options
author | Burt Holzman <burt@fnal.gov> | 2013-01-24 00:24:09 -0600 |
---|---|---|
committer | Burt Holzman <burt@fnal.gov> | 2013-01-24 17:11:10 -0600 |
commit | dfec46ac8e4cba23da842698c2bc746c03994afe (patch) | |
tree | 96209b11f99fd93835f6952d8aae40b6ee081eaa /nova/wsgi.py | |
parent | 33680e6b2d2026ae8394579586f02d9773649674 (diff) | |
download | nova-dfec46ac8e4cba23da842698c2bc746c03994afe.tar.gz nova-dfec46ac8e4cba23da842698c2bc746c03994afe.tar.xz nova-dfec46ac8e4cba23da842698c2bc746c03994afe.zip |
Increase maximum URI size for EC2 API to 16k
The EC2 API supports both HTTP GET and POST agnostically. It also supports
user-data of 16k -- meaning that client tools could generate 16k URIs.
The WSGI default limit is 8k; this raises it.
Fixes bug 1098646.
Change-Id: Idec460d88b2affab970c9d9f39fa61295db035c5
Diffstat (limited to 'nova/wsgi.py')
-rw-r--r-- | nova/wsgi.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/nova/wsgi.py b/nova/wsgi.py index 0a7570b6c..651dbc4f6 100644 --- a/nova/wsgi.py +++ b/nova/wsgi.py @@ -75,7 +75,7 @@ class Server(object): def __init__(self, name, app, host='0.0.0.0', port=0, pool_size=None, protocol=eventlet.wsgi.HttpProtocol, backlog=128, - use_ssl=False): + use_ssl=False, max_url_len=None): """Initialize, but do not start, a WSGI server. :param name: Pretty name for logging. @@ -84,6 +84,7 @@ class Server(object): :param port: Port number to server the application. :param pool_size: Maximum number of eventlets to spawn concurrently. :param backlog: Maximum number of queued connections. + :param max_url_len: Maximum length of permitted URLs. :returns: None :raises: nova.exception.InvalidInput """ @@ -95,6 +96,7 @@ class Server(object): self._logger = logging.getLogger("nova.%s.wsgi.server" % self.name) self._wsgi_logger = logging.WritableLogger(self._logger) self._use_ssl = use_ssl + self._max_url_len = max_url_len if backlog < 1: raise exception.InvalidInput( @@ -177,13 +179,20 @@ class Server(object): ":%(port)s with SSL support") % self.__dict__) raise - self._server = eventlet.spawn(eventlet.wsgi.server, - self._socket, - self.app, - protocol=self._protocol, - custom_pool=self._pool, - log=self._wsgi_logger, - log_format=CONF.wsgi_log_format) + wsgi_kwargs = { + 'func': eventlet.wsgi.server, + 'sock': self._socket, + 'site': self.app, + 'protocol': self._protocol, + 'custom_pool': self._pool, + 'log': self._wsgi_logger, + 'log_format': CONF.wsgi_log_format + } + + if self._max_url_len: + wsgi_kwargs['url_length_limit'] = self._max_url_len + + self._server = eventlet.spawn(**wsgi_kwargs) def stop(self): """Stop this server. |