Browse Source

Allow setting eventlet.wsgi.MAX_HEADER_LINE

This commit allows setting wsgi MAX_HEADER_LINE. This is done to allow
large keystone tokens. Also removes seeimngly unused run_server
function, to not cause confustion.

Change-Id: I2848c08d0758f39cb988079a8fabf36d6d2a2c98
Closes-Bug: #1190149
tags/2015.1.1
Kirill Zaitsev 3 years ago
parent
commit
99a727e346
2 changed files with 10 additions and 9 deletions
  1. 9
    8
      murano/common/wsgi.py
  2. 1
    1
      murano/opts.py

+ 9
- 8
murano/common/wsgi.py View File

@@ -43,7 +43,7 @@ from murano.openstack.common import log as logging
43 43
 from murano.openstack.common import service
44 44
 from murano.openstack.common import sslutils
45 45
 
46
-socket_opts = [
46
+wsgi_opts = [
47 47
     cfg.IntOpt('backlog',
48 48
                default=4096,
49 49
                help="Number of backlog requests to configure the socket with"),
@@ -51,20 +51,20 @@ socket_opts = [
51 51
                default=600,
52 52
                help="Sets the value of TCP_KEEPIDLE in seconds for each "
53 53
                     "server socket. Not supported on OS X."),
54
+    cfg.IntOpt('max_header_line',
55
+               default=16384,
56
+               help="Maximum line size of message headers to be accepted. "
57
+                    "max_header_line may need to be increased when using "
58
+                    "large tokens (typically those generated by the "
59
+                    "Keystone v3 API with big service catalogs)."),
54 60
 ]
55 61
 
56 62
 CONF = cfg.CONF
57
-CONF.register_opts(socket_opts)
63
+CONF.register_opts(wsgi_opts)
58 64
 
59 65
 LOG = logging.getLogger(__name__)
60 66
 
61 67
 
62
-def run_server(application, port):
63
-    """Run a WSGI server with the given application."""
64
-    sock = eventlet.listen(('0.0.0.0', port))
65
-    eventlet.wsgi.server(sock, application)
66
-
67
-
68 68
 class Service(service.Service):
69 69
     """Provides a Service API for wsgi servers.
70 70
 
@@ -154,6 +154,7 @@ class Service(service.Service):
154 154
     def _run(self, application, socket):
155 155
         """Start a WSGI server in a new green thread."""
156 156
         logger = logging.getLogger('eventlet.wsgi')
157
+        eventlet.wsgi.MAX_HEADER_LINE = CONF.max_header_line
157 158
         eventlet.wsgi.server(socket,
158 159
                              application,
159 160
                              custom_pool=self.tg.pool,

+ 1
- 1
murano/opts.py View File

@@ -45,7 +45,7 @@ _opt_lists = [
45 45
         murano.common.config.metadata_dir,
46 46
         murano.common.config.bind_opts,
47 47
         murano.common.config.file_server,
48
-        murano.common.wsgi.socket_opts,
48
+        murano.common.wsgi.wsgi_opts,
49 49
         murano.openstack.common.log.common_cli_opts,
50 50
         murano.openstack.common.log.generic_log_opts,
51 51
         murano.openstack.common.log.log_opts,

Loading…
Cancel
Save