Commit Graph

13 Commits

Author SHA1 Message Date
Luminita Voicu
eb8b8cb53d Add optional limit on request size
Signed-off-by: Luminita Voicu <lumivo@amazon.com>
2021-07-09 11:32:22 +03:00
YUAN LYU
9e6ab4b5ab Clean up after cherry-picking commits from firecracker
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Gulshan Kumar
67fd749e03 Removed Unnecessary pub
Signed-off-by: Gulshan Kumar <kumargu@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Alexandru Cihodaru
683b85d07e Added support for Accept-Encoding
Signed-off-by: Alexandru Cihodaru <cihodar@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
cihodar
8a8d7bb5b1 Made InvalidHeader error more verbose.
Changed the way we handle TransferEncoding
and added new test cases.

Signed-off-by: cihodar <cihodar@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Damien Stanton
eeae4ac11d Remove all extern crate...
In Rust 2018 edition, it is considered unidiomatic to use "extern crate"
sunthax. The proper way to do it is to replace extern crate with "use"
declarations.

- Also impl clippy suggestions for fn main removal in doctests
- Fix unneeded box allocations and clones

Signed-off-by: Damien Stanton <damien.stanton@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Damien Stanton
a7f035b8c5 micro_http: switch to rust edition 2018
Signed-off-by: Damien Stanton <damien.stanton@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Adrian Catangiu
d288940391 micro_http: gracefully handle EINTR
EINTR errors should not break the HttpServer requests loop,
they are internally consumed and reported as no events rather
than requests errors.

Signed-off-by: Adrian Catangiu <acatan@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Laura Loghin
548d297be7 Completely remove epoll crate dependency
Move epoll.rs from polly to utils crate and use this file,
in micro_http, as an epoll wrapper instead of the epoll crate.

Signed-off-by: Laura Loghin <lauralg@amazon.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Liu Jiang
8ca0839b58 Simplify the HttpRoute trait
Previously the HttpRoute has logic to clone the handler parameter,
which is an implementation detail of the API server. So simplify
the HttpRoute interfaces by removing the argument cloning logic.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-03-30 13:52:34 +03:00
Liu Jiang
ac3bb940ab Import http routes from Cloud Hypervisor project
Import vmm/src/api/http.rs from Cloud Hyerpvisor project, commit
345c922cb9a88183e2da9d29230ecb945b0a6452 with following changes:
1) use generic type for handler argument.
2) remove server thread relative code.
3) add unit test cases.
4) refine for better code reuse.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-03-30 13:52:34 +03:00
Liu Jiang
fbb4d5392a Refine code for rust edition 2018
Refine code to support rust edition 2018, no functional changes.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-03-30 13:52:34 +03:00
Andreea Florescu
6708271862 initial commit
Pulled the code from firecracker-microvm/src/micro-http.

Signed-off-by: George Pisaltu <gpl@amazon.com>
Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-01-27 12:28:50 +02:00