From c7059ae54ef2712e7599a6de30a631d3a0bb6bd2 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Wed, 22 Aug 2012 16:45:27 +0200 Subject: [PATCH] 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 --- heat/common/wsgi.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/heat/common/wsgi.py b/heat/common/wsgi.py index ecf0ae75d3..32b5bbcad3 100644 --- a/heat/common/wsgi.py +++ b/heat/common/wsgi.py @@ -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))