Crates.io | tk-sendfile |
lib.rs | tk-sendfile |
version | 0.4.0 |
source | src |
created_at | 2016-10-17 15:05:14.591231 |
updated_at | 2017-03-30 15:03:31.646625 |
description | A high-performance file serving library. Serves files in special IO threads. In this version it uses normal file reading, but we will optimize using `sendfile` on supported systems as quick as tokio allows us to do that. |
homepage | http://github.com/tailhook/tk-sendfile |
repository | |
max_upload_size | |
id | 6885 |
size | 35,416 |
: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:
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
Doing more than single sendfile
operation requires some bookkeeping
It should be possible to implement file cache (both opened files and in-memory file data) transparently for the user
[TODO] Serving user-specified file paths requires non-trivial code to prevent symlink attacks
Licensed under either of
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.