https://github.com/tailhook/tk-sendfile
A thread pool for rust/tokio that can process file requests and send data to the socket with zero copy (using sendfile)
https://github.com/tailhook/tk-sendfile
Last synced: 6 months ago
JSON representation
A thread pool for rust/tokio that can process file requests and send data to the socket with zero copy (using sendfile)
- Host: GitHub
- URL: https://github.com/tailhook/tk-sendfile
- Owner: tailhook
- License: apache-2.0
- Created: 2016-10-13T20:46:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-30T15:01:37.000Z (almost 9 years ago)
- Last Synced: 2025-08-10T19:43:04.800Z (6 months ago)
- Language: Rust
- Size: 29.3 KB
- Stars: 29
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE-APACHE
Awesome Lists containing this project
README
Sendfile for Tokio
==================
:Status: alpha
:Documentation: http://docs.rs/tk-sendfile
A thread pool that can process file requests and send data to the socket
with zero copy (using sendfile).
Challenges:
1. While ``sendfile`` is non-blocking when writing to socket, it blocks for
disk access for two cases: initial ``open()`` and for reading file inside
the ``sendfile()`` system call itself
2. Doing more than single ``sendfile`` operation requires some bookkeeping
3. It should be possible to implement file cache (both opened files and
in-memory file data) transparently for the user
4. [TODO] Serving user-specified file paths requires non-trivial code to
prevent symlink attacks
License
=======
Licensed under either of
* Apache License, Version 2.0,
(./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
------------
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.