diff --git a/src/router/serve/unix.rs b/src/router/serve/unix.rs index fcd361f0..6855b34c 100644 --- a/src/router/serve/unix.rs +++ b/src/router/serve/unix.rs @@ -106,7 +106,10 @@ async fn accepted( trace!(?socket, ?handler, "serving connection"); // bug on darwin causes all results to be errors. do not unwrap this - _ = builder.serve_connection(socket, handler).await; + tokio::select! { + () = server.until_shutdown() => (), + _ = builder.serve_connection(socket, handler) => (), + }; } async fn init(server: &Arc) -> Result {