diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-08-18 17:35:02 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-18 17:35:02 +0530 |
commit | cd21cff29942f24ba7d38287186cce64d0e84e56 (patch) | |
tree | e663eff884526ee762ae9141a3cf5a0f6967a84e /runtime/ops/io.rs | |
parent | 0b0843e4a54d7c1ddf293ac1ccee2479b69a5ba9 (diff) |
feat(ext/flash): An optimized http/1.1 server (#15405)
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'runtime/ops/io.rs')
-rw-r--r-- | runtime/ops/io.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/runtime/ops/io.rs b/runtime/ops/io.rs index 2dcb9964a..900be1034 100644 --- a/runtime/ops/io.rs +++ b/runtime/ops/io.rs @@ -582,6 +582,16 @@ impl Resource for StdFileResource { fn write(self: Rc<Self>, buf: ZeroCopyBuf) -> AsyncResult<usize> { Box::pin(self.write(buf)) } + + #[cfg(unix)] + fn backing_fd(self: Rc<Self>) -> Option<std::os::unix::prelude::RawFd> { + use std::os::unix::io::AsRawFd; + self + .with_inner_and_metadata(move |std_file, _| { + Ok(std_file.with_file(|f| f.as_raw_fd())) + }) + .ok() + } } // override op_print to use the stdout and stderr in the resource table |