From c464cd7073c761780b3170a48542c387560e3f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 12 Oct 2023 17:55:50 +0200 Subject: refactor: FeatureChecker integration in ext/ crates (#20797) Towards https://github.com/denoland/deno/issues/20779. --- ext/http/http_next.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ext/http') diff --git a/ext/http/http_next.rs b/ext/http/http_next.rs index 90f7f0b1d..522df280f 100644 --- a/ext/http/http_next.rs +++ b/ext/http/http_next.rs @@ -83,6 +83,8 @@ static USE_WRITEV: Lazy = Lazy::new(|| { false }); +pub const UNSTABLE_FEATURE_NAME: &str = "http"; + /// All HTTP/2 connections start with this byte string. /// /// In HTTP/2, each endpoint is required to send a connection preface as a final confirmation @@ -1105,10 +1107,16 @@ pub async fn op_http_close( .take::(rid)?; if graceful { + // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` + // once we phase out `check_or_exit_with_legacy_fallback` state .borrow() .feature_checker - .check_legacy_unstable_or_exit("Deno.Server.shutdown"); + .check_or_exit_with_legacy_fallback( + UNSTABLE_FEATURE_NAME, + "Deno.Server.shutdown", + ); + // In a graceful shutdown, we close the listener and allow all the remaining connections to drain join_handle.listen_cancel_handle().cancel(); } else { -- cgit v1.2.3