Better exception
This commit is contained in:
parent
96a746e468
commit
6e3e5f1662
@ -185,7 +185,9 @@ class RunnerMixin(metaclass=SanicMeta):
|
||||
) -> None:
|
||||
if version == 3 and self.state.server_info:
|
||||
raise RuntimeError(
|
||||
"Serving multiple HTTP/3 instances is not supported."
|
||||
"Serving HTTP/3 instances as a secondary server is "
|
||||
"not supported. There can only be a single HTTP/3 worker "
|
||||
"and it must be prepared first."
|
||||
)
|
||||
|
||||
if dev:
|
||||
|
@ -95,8 +95,47 @@ def serve(
|
||||
app.asgi = False
|
||||
|
||||
if version is HTTP.VERSION_3:
|
||||
return serve_http_3(host, port, app, loop, ssl)
|
||||
return _serve_http_3(host, port, app, loop, ssl)
|
||||
return _serve_http_1(
|
||||
host,
|
||||
port,
|
||||
app,
|
||||
ssl,
|
||||
sock,
|
||||
unix,
|
||||
reuse_port,
|
||||
loop,
|
||||
protocol,
|
||||
backlog,
|
||||
register_sys_signals,
|
||||
run_multiple,
|
||||
run_async,
|
||||
connections,
|
||||
signal,
|
||||
state,
|
||||
asyncio_server_kwargs,
|
||||
)
|
||||
|
||||
|
||||
def _serve_http_1(
|
||||
host,
|
||||
port,
|
||||
app,
|
||||
ssl,
|
||||
sock,
|
||||
unix,
|
||||
reuse_port,
|
||||
loop,
|
||||
protocol,
|
||||
backlog,
|
||||
register_sys_signals,
|
||||
run_multiple,
|
||||
run_async,
|
||||
connections,
|
||||
signal,
|
||||
state,
|
||||
asyncio_server_kwargs,
|
||||
):
|
||||
connections = connections if connections is not None else set()
|
||||
protocol_kwargs = _build_protocol_kwargs(protocol, app.config)
|
||||
server = partial(
|
||||
@ -201,7 +240,7 @@ def serve(
|
||||
remove_unix_socket(unix)
|
||||
|
||||
|
||||
def serve_http_3(
|
||||
def _serve_http_3(
|
||||
host,
|
||||
port,
|
||||
app,
|
||||
|
Loading…
x
Reference in New Issue
Block a user