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>
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>
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>
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>
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>