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
This commit is contained in:
parent
19098f9fcf
commit
99a727e346
|
@ -43,7 +43,7 @@ from murano.openstack.common import log as logging
|
||||||
from murano.openstack.common import service
|
from murano.openstack.common import service
|
||||||
from murano.openstack.common import sslutils
|
from murano.openstack.common import sslutils
|
||||||
|
|
||||||
socket_opts = [
|
wsgi_opts = [
|
||||||
cfg.IntOpt('backlog',
|
cfg.IntOpt('backlog',
|
||||||
default=4096,
|
default=4096,
|
||||||
help="Number of backlog requests to configure the socket with"),
|
help="Number of backlog requests to configure the socket with"),
|
||||||
|
@ -51,20 +51,20 @@ socket_opts = [
|
||||||
default=600,
|
default=600,
|
||||||
help="Sets the value of TCP_KEEPIDLE in seconds for each "
|
help="Sets the value of TCP_KEEPIDLE in seconds for each "
|
||||||
"server socket. Not supported on OS X."),
|
"server socket. Not supported on OS X."),
|
||||||
|
cfg.IntOpt('max_header_line',
|
||||||
|
default=16384,
|
||||||
|
help="Maximum line size of message headers to be accepted. "
|
||||||
|
"max_header_line may need to be increased when using "
|
||||||
|
"large tokens (typically those generated by the "
|
||||||
|
"Keystone v3 API with big service catalogs)."),
|
||||||
]
|
]
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
CONF.register_opts(socket_opts)
|
CONF.register_opts(wsgi_opts)
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def run_server(application, port):
|
|
||||||
"""Run a WSGI server with the given application."""
|
|
||||||
sock = eventlet.listen(('0.0.0.0', port))
|
|
||||||
eventlet.wsgi.server(sock, application)
|
|
||||||
|
|
||||||
|
|
||||||
class Service(service.Service):
|
class Service(service.Service):
|
||||||
"""Provides a Service API for wsgi servers.
|
"""Provides a Service API for wsgi servers.
|
||||||
|
|
||||||
|
@ -154,6 +154,7 @@ class Service(service.Service):
|
||||||
def _run(self, application, socket):
|
def _run(self, application, socket):
|
||||||
"""Start a WSGI server in a new green thread."""
|
"""Start a WSGI server in a new green thread."""
|
||||||
logger = logging.getLogger('eventlet.wsgi')
|
logger = logging.getLogger('eventlet.wsgi')
|
||||||
|
eventlet.wsgi.MAX_HEADER_LINE = CONF.max_header_line
|
||||||
eventlet.wsgi.server(socket,
|
eventlet.wsgi.server(socket,
|
||||||
application,
|
application,
|
||||||
custom_pool=self.tg.pool,
|
custom_pool=self.tg.pool,
|
||||||
|
|
|
@ -45,7 +45,7 @@ _opt_lists = [
|
||||||
murano.common.config.metadata_dir,
|
murano.common.config.metadata_dir,
|
||||||
murano.common.config.bind_opts,
|
murano.common.config.bind_opts,
|
||||||
murano.common.config.file_server,
|
murano.common.config.file_server,
|
||||||
murano.common.wsgi.socket_opts,
|
murano.common.wsgi.wsgi_opts,
|
||||||
murano.openstack.common.log.common_cli_opts,
|
murano.openstack.common.log.common_cli_opts,
|
||||||
murano.openstack.common.log.generic_log_opts,
|
murano.openstack.common.log.generic_log_opts,
|
||||||
murano.openstack.common.log.log_opts,
|
murano.openstack.common.log.log_opts,
|
||||||
|
|
Loading…
Reference in New Issue