summaryrefslogtreecommitdiff
path: root/ext/http/http_next.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-06-08 12:55:33 +0200
committerGitHub <noreply@github.com>2023-06-08 12:55:33 +0200
commit0197f42e6bd77c9bd6f14afd9523c4c252aa099b (patch)
tree8ba7aa753cfb702a897a9730e3cb8afca54b75ca /ext/http/http_next.rs
parentdd6458b30a4c1ecf4fab1eaffb4563734c5df284 (diff)
perf: use sendto syscalls (#19414)
This switches syscall used in HTTP and WS server from "writev" to "sendto". "DENO_USE_WRITEV=1" can be used to enable using "writev" syscall. Doing this for easier testing of various setups.
Diffstat (limited to 'ext/http/http_next.rs')
-rw-r--r--ext/http/http_next.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/http/http_next.rs b/ext/http/http_next.rs
index 900a956f4..93634ae3e 100644
--- a/ext/http/http_next.rs
+++ b/ext/http/http_next.rs
@@ -73,13 +73,13 @@ type Request = hyper1::Request<Incoming>;
type Response = hyper1::Response<ResponseBytes>;
static USE_WRITEV: Lazy<bool> = Lazy::new(|| {
- let disable_writev = std::env::var("DENO_HYPER_USE_WRITEV").ok();
+ let enable = std::env::var("DENO_USE_WRITEV").ok();
- if let Some(val) = disable_writev {
- return val != "0";
+ if let Some(val) = enable {
+ return !val.is_empty();
}
- true
+ false
});
/// All HTTP/2 connections start with this byte string.