dumbo: remove dumbo's dependency on mmds

This moves dumbo::ns to mmds crate and
implements response retrieval callback passed to dumbo's tcp::handler

Signed-off-by: moricho <ikeda.morito@gmail.com>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
This commit is contained in:
moricho
2020-04-22 20:49:15 +09:00
committed by Adrian Catangiu
parent c5a3f9f543
commit 9830b66a09

View File

@@ -51,6 +51,7 @@ impl StatusCode {
}
}
#[derive(Debug, PartialEq)]
struct StatusLine {
http_version: Version,
status_code: StatusCode,
@@ -77,6 +78,7 @@ impl StatusLine {
/// Wrapper over the list of headers associated with a HTTP Response.
/// When creating a ResponseHeaders object, the content type is initialized to `text/plain`.
/// The content type can be updated with a call to `set_content_type`.
#[derive(Debug, PartialEq)]
pub struct ResponseHeaders {
content_length: i32,
content_type: MediaType,
@@ -164,6 +166,7 @@ impl ResponseHeaders {
/// the body is initialized to `None` and the header is initialized with the `default` value. The body
/// can be updated with a call to `set_body`. The header can be updated with `set_content_type` and
/// `set_server`.
#[derive(Debug, PartialEq)]
pub struct Response {
status_line: StatusLine,
headers: ResponseHeaders,