Commit graph

6 commits

Author SHA1 Message Date
Дамјан Георгиевски
e8d3481108 the size is not bytes but objects
and objects were byte arrays (typically 8KB).

limit it to 64, so typically not more than 512kb is used. doesn't change
the max speed when downloading on localhost, and decreases the RSS usage
with slow clients.
2018-07-13 09:48:42 +02:00
Дамјан Георгиевски
e9ef0d582e insignificant changes
* renamed `run_tar_in_thread()` to `stream_tar_in_thread()`
* use `impl Responder` instead of `Result<HttpResponse>`
* add an `.unwrap()` to `StaticFiles::new()` (seems to be an upstream API change)
2018-07-08 16:07:32 +02:00
Дамјан Георгиевски
803ffc0c99 use futures::sync::mpsc::channel() with 4MB buffer
… instead of unbounded() with no limits in buffering

this should implement a back pressure, when the client can't read the
response fast enough, the thread creating the archive would block the
write, instead of filling the memory.

Use Sink::wait() to make a blocking Sender
2018-07-07 23:49:46 +02:00
Дамјан Георгиевски
62a99f8dc3 use just last part of pathname in the tar
Previously:
```
$ curl -s http://localhost:8000/target/release/build.tar -o - | tar tf -
target/release/build/rayon-core-b8ae11d289218da3
…
```

Now:
```
$ curl -s http://localhost:8000/target/release/build.tar -o - | tar tf -
build/rayon-core-b8ae11d289218da3
…
```
2018-07-07 23:47:35 +02:00
Дамјан Георгиевски
17a40e188a forgot the second point 2018-07-05 17:57:12 +02:00
Дамјан Георгиевски
fd46bfb55a refactor: split code in multiple files
… main.rs is now small enough to add cli args
2018-07-05 17:48:40 +02:00