summaryrefslogtreecommitdiff
path: root/ext/http/http_next.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-10-12 17:55:50 +0200
committerGitHub <noreply@github.com>2023-10-12 15:55:50 +0000
commitc464cd7073c761780b3170a48542c387560e3f26 (patch)
tree881a26d05423f9c696c8f35ce8bd2d72d562b1ea /ext/http/http_next.rs
parent5dd010a4fbeb0602891ea537b98216b8ad7d27a7 (diff)
refactor: FeatureChecker integration in ext/ crates (#20797)
Towards https://github.com/denoland/deno/issues/20779.
Diffstat (limited to 'ext/http/http_next.rs')
-rw-r--r--ext/http/http_next.rs10
1 files changed, 9 insertions, 1 deletions
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<bool> = 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::<HttpJoinHandle>(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 {