Commit graph

22 commits

Author SHA1 Message Date
Damjan Georgievski
091f203317 use a non default logger that doesn't log the timestamp
the env_logger already adds the timestamp, so it was redundant

before:
`INFO 2018-07-21T12:57:49Z: actix_web::middleware::logger: 127.0.0.1:42112 [21/Jul/2018:14:57:49 +0200] "GET / HTTP/1.1" 200 858 "-" "curl/7.61.0" 0.000686`

after:
`INFO 2018-07-21T13:03:20Z: actix_web::middleware::logger: 127.0.0.1:42154 "GET / HTTP/1.1" 200 858 "-" "curl/7.61.0" 0.000367`
2018-07-21 15:13:30 +02:00
Damjan Georgievski
a6a3d707d6 implement a default logger
I've snuck some renames of variables too
2018-07-21 14:59:47 +02:00
Damjan Georgievski
a4d895ea4a bump to the axtix-web 0.7 release 2018-07-21 14:39:29 +02:00
Дамјан Георгиевски
c91c994c8c actix_web reexports actix
Re-export actix::prelude::* as actix_web::actix module.

So no need to explicitly import it or add it in Cargo.toml
2018-07-19 20:03:17 +02:00
Дамјан Георгиевски
ca4cc0a941 actix 0.7 has been released, no need to patch the dependency 2018-07-15 18:59:49 +02:00
Дамјан Георгиевски
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
Дамјан Георгиевски
9a56bcb1a0 slight reorganization of the html generation 2018-07-08 16:11:19 +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
Дамјан Георгиевски
de0040512b try to build smaller --release binaries 2018-07-05 18:04:11 +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
Дамјан Георгиевски
b8f4607dba fancier dir list template 2018-07-05 10:55:22 +02:00
Дамјан Георгиевски
591587649c sort directories first, and then alphabetically by filename 2018-07-04 23:41:54 +02:00
Дамјан Георгиевски
a8fef98041 charset=utf-8 2018-07-04 23:31:02 +02:00
Дамјан Георгиевски
95adb78666 double quotes for html attribute values 2018-07-04 23:30:37 +02:00
Дамјан Георгиевски
46ffbeaa6e implement streaming of a folder as a tar 2018-07-04 23:14:05 +02:00
Дамјан Георгиевски
b5533e1428 implement custom directory listing 2018-07-04 23:13:32 +02:00
Дамјан Георгиевски
27eec3f434 added some new dependencies 2018-07-04 23:11:57 +02:00
Дамјан Георгиевски
7845a4e3d7 first skeleton 2018-07-04 14:03:30 +02:00
Дамјан Георгиевски
7cd907b78d initial idea commited 2018-07-04 13:57:42 +02:00