Disable vectored writes

This commit is contained in:
Filip Tibell 2025-04-28 12:40:37 +02:00
parent b41980d6e1
commit 91d3becfa7
No known key found for this signature in database
3 changed files with 8 additions and 16 deletions

View file

@ -81,6 +81,7 @@ pub async fn serve(lua: Lua, port: u16, config: ServeConfig) -> LuaResult<ServeH
let handle_dropped = Rc::clone(&handle_dropped);
async move {
let conn = Http1Builder::new()
.writev(false)
.timer(HyperTimer)
.keep_alive(true)
.serve_connection(io, svc)

View file

@ -163,14 +163,6 @@ impl<T: AsyncWrite> rt::Write for HyperIo<T> {
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
self.pin_mut().poll_close(cx)
}
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[io::IoSlice<'_>],
) -> Poll<io::Result<usize>> {
self.pin_mut().poll_write_vectored(cx, bufs)
}
}
// Compat for hyper runtime -> futures-lite
@ -203,12 +195,4 @@ impl<T: rt::Write> AsyncWrite for HyperIo<T> {
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
self.pin_mut().poll_shutdown(cx)
}
fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[std::io::IoSlice<'_>],
) -> Poll<Result<usize, std::io::Error>> {
self.pin_mut().poll_write_vectored(cx, bufs)
}
}

7
test.luau Normal file
View file

@ -0,0 +1,7 @@
local net = require("@lune/net")
local handle = net.serve(8080, function()
return "Hello, World!"
end)
print(`Server started on {handle.ip}:{handle.port}`)