mirror of
https://github.com/lune-org/lune.git
synced 2025-05-04 10:43:57 +01:00
Disable vectored writes
This commit is contained in:
parent
b41980d6e1
commit
91d3becfa7
3 changed files with 8 additions and 16 deletions
|
@ -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)
|
||||
|
|
|
@ -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
7
test.luau
Normal 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}`)
|
Loading…
Add table
Reference in a new issue