mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update web-platform-tests to revision 66dc9c93f2c8ebd7c8fdc28fae20d92713c97806
This commit is contained in:
parent
e488ea750b
commit
12f4ae132e
1651 changed files with 8123 additions and 14152 deletions
|
@ -575,13 +575,11 @@ def start_http2_server(host, port, paths, routes, bind_address, config, **kwargs
|
|||
|
||||
|
||||
class WebSocketDaemon(object):
|
||||
def __init__(self, host, port, doc_root, handlers_root, log_level, bind_address,
|
||||
ssl_config):
|
||||
def __init__(self, host, port, doc_root, handlers_root, bind_address, ssl_config):
|
||||
self.host = host
|
||||
cmd_args = ["-p", port,
|
||||
"-d", doc_root,
|
||||
"-w", handlers_root,
|
||||
"--log-level", log_level]
|
||||
"-w", handlers_root]
|
||||
|
||||
if ssl_config is not None:
|
||||
# This is usually done through pywebsocket.main, however we're
|
||||
|
@ -605,17 +603,6 @@ class WebSocketDaemon(object):
|
|||
opts, args = pywebsocket._parse_args_and_config(cmd_args)
|
||||
opts.cgi_directories = []
|
||||
opts.is_executable_method = None
|
||||
|
||||
# Logging needs to be configured both before and after reloading,
|
||||
# because some modules store loggers as global variables.
|
||||
pywebsocket._configure_logging(opts)
|
||||
# Ensure that when we start this in a new process we have the global
|
||||
# lock in the logging module unlocked.
|
||||
reload_module(logging)
|
||||
release_mozlog_lock()
|
||||
pywebsocket._configure_logging(opts)
|
||||
# DO NOT LOG BEFORE THIS LINE.
|
||||
|
||||
self.server = pywebsocket.WebSocketServer(opts)
|
||||
ports = [item[0].getsockname()[1] for item in self.server._sockets]
|
||||
assert all(item == ports[0] for item in ports)
|
||||
|
@ -662,21 +649,27 @@ def release_mozlog_lock():
|
|||
|
||||
|
||||
def start_ws_server(host, port, paths, routes, bind_address, config, **kwargs):
|
||||
# Ensure that when we start this in a new process we have the global lock
|
||||
# in the logging module unlocked
|
||||
reload_module(logging)
|
||||
release_mozlog_lock()
|
||||
return WebSocketDaemon(host,
|
||||
str(port),
|
||||
repo_root,
|
||||
config.paths["ws_doc_root"],
|
||||
config.log_level.lower(),
|
||||
bind_address,
|
||||
ssl_config=None)
|
||||
|
||||
|
||||
def start_wss_server(host, port, paths, routes, bind_address, config, **kwargs):
|
||||
# Ensure that when we start this in a new process we have the global lock
|
||||
# in the logging module unlocked
|
||||
reload_module(logging)
|
||||
release_mozlog_lock()
|
||||
return WebSocketDaemon(host,
|
||||
str(port),
|
||||
repo_root,
|
||||
config.paths["ws_doc_root"],
|
||||
config.log_level.lower(),
|
||||
bind_address,
|
||||
config.ssl_config)
|
||||
|
||||
|
@ -849,6 +842,8 @@ def run(**kwargs):
|
|||
global logger
|
||||
logger = config.logger
|
||||
set_logger(logger)
|
||||
# Configure the root logger to cover third-party libraries.
|
||||
logging.getLogger().setLevel(config.log_level)
|
||||
|
||||
def handle_signal(signum, frame):
|
||||
logger.debug("Received signal %s. Shutting down.", signum)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue