Commit Graph

8 Commits

Author SHA1 Message Date
Luminita Voicu
81a3c71efb increase coverage
Signed-off-by: Luminita Voicu <lumivo@amazon.com>
2021-07-09 11:32:22 +03:00
William Douglas
9b605a8b61 Enable creating a socket from an existing fd
Allow the creation of the http server's socket from an existing
fd. This is done to enable another process to initiate the creation of
a server by preparing the socket so it can immediately be used rather
than polling to connect to the path.

Note, the coverage file change due to what appears to be a rounding
error when calculating coverage.

Signed-off-by: William Douglas <william.douglas@intel.com>
2021-04-20 11:15:44 +03:00
YUAN LYU
49240ce1d5 Add unit tests to raise coverage score
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
2021-04-15 11:21:32 +03:00
Changwei Ge
59ab64440a Add http status code 503
When we are not capable to provide a certain kind of service, but should be
after some delay. Http server is better to reply status code 503. It is more
suggestive per as to http spec.

```
The server is currently unable to handle the request due to a temporary
overload or scheduled maintenance, which will likely be alleviated after some delay.
```

Signed-off-by: Changwei Ge <chge@linux.alibaba.com>
2020-11-03 08:38:02 +02:00
Adrian Catangiu
c33861a13b Handle ErrorKind::Interrupted when waiting for events
ErrorKind::Interrupted (libc::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>
2020-07-23 18:17:33 +03:00
Liu Jiang
c9ffb90aeb Handle ErrorKind::Interrupted when doing stream IO
When doing IO with the underlying stream object, we should handle
the special case of ErrorKind::Interrupted, otherwise the connection
will be closed incorrectly.

Quotation from Rust doc:
An error of the [`ErrorKind::Interrupted`] kind is non-fatal and the
read operation should be retried if there is nothing else to do.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-04-27 09:41:16 +03:00
Liu Jiang
0d87a94c8e Route request according to {method, path} tuple
Route request according to {method, path} tuple, so we could use only
one router for each http server.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2020-03-30 13:52:34 +03:00
Andreea Florescu
fc538a8ba0 Added Buildkite CI
It's easier to test this with the rust-vmm-ci directly as it already
runs all the basic tests.

Signed-off-by: Andreea Florescu <fandree@amazon.com>
2020-01-30 15:21:04 +02:00