Set the max url length in eventlet 0.9.17

The version with configurable url limit was released and packaged for
Fedora 17.

The monkey-patch does not work on new eventlet.

ref #55
fixes #197

Change-Id: I728cc3b0851261667bb9b07220c855bced1344a4
Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
This commit is contained in:
Tomas Sedovic 2012-08-22 16:45:27 +02:00
parent 5e41a1ee73
commit c7059ae54e

View File

@ -48,8 +48,11 @@ from heat.openstack.common import importutils
from heat.openstack.common import utils
# TODO(shadower) remove this once eventlet with fix from #55 gets released
eventlet.wsgi.MAX_REQUEST_LINE = 50000
URL_LENGTH_LIMIT = 50000
# TODO(shadower) remove this once eventlet 0.9.17 is in distros Heat
# supports (notably Fedora 17 and Ubuntu 12.04 and newer)
eventlet.wsgi.MAX_REQUEST_LINE = URL_LENGTH_LIMIT
bind_opts = [
cfg.StrOpt('bind_host', default='0.0.0.0'),
@ -240,7 +243,9 @@ class Server(object):
self.pool = eventlet.GreenPool(size=self.threads)
try:
eventlet.wsgi.server(self.sock, self.application,
log=WritableLogger(self.logger), custom_pool=self.pool)
url_length_limit=URL_LENGTH_LIMIT,
custom_pool=self.pool,
log=WritableLogger(self.logger))
except socket.error, err:
if err[0] != errno.EINVAL:
raise
@ -249,7 +254,9 @@ class Server(object):
def _single_run(self, application, sock):
"""Start a WSGI server in a new green thread."""
self.logger.info(_("Starting single process server"))
eventlet.wsgi.server(sock, application, custom_pool=self.pool,
eventlet.wsgi.server(sock, application,
custom_pool=self.pool,
url_length_limit=URL_LENGTH_LIMIT,
log=WritableLogger(self.logger))