summaryrefslogtreecommitdiff
path: root/ext/http/http_next.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-12-07 00:43:01 +0100
committerGitHub <noreply@github.com>2023-12-06 23:43:01 +0000
commita931a47511f0f1160f2446a543fed867ea59703b (patch)
treeafdff7a6823dee30cb4330f837156897afefea26 /ext/http/http_next.rs
parente372fc73e806faeeb3c67df2d5b10a63fe5e8213 (diff)
feat: stabilize Deno.HttpServer.shutdown and Unix socket support (#21463)
This commit stabilizes "Deno.HttpServer.shutdown" API as well as Unix socket support in "Deno.serve" API. --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'ext/http/http_next.rs')
-rw-r--r--ext/http/http_next.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/ext/http/http_next.rs b/ext/http/http_next.rs
index db63601a0..217ae1c39 100644
--- a/ext/http/http_next.rs
+++ b/ext/http/http_next.rs
@@ -87,6 +87,11 @@ static USE_WRITEV: Lazy<bool> = Lazy::new(|| {
false
});
+// NOTE(bartlomieju): currently we don't have any unstable HTTP features,
+// but let's keep this const here, because:
+// a) we still need to support `--unstable-http` flag to not break user's CLI;
+// b) we might add more unstable features in the future.
+#[allow(dead_code)]
pub const UNSTABLE_FEATURE_NAME: &str = "http";
/// All HTTP/2 connections start with this byte string.
@@ -1183,16 +1188,6 @@ pub async fn op_http_close(
if graceful {
http_general_trace!("graceful shutdown");
- // 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_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();
poll_fn(|cx| join_handle.server_state.poll_complete(cx)).await;