1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-01 01:16:59 +02:00

complete impl for client request and response

This commit is contained in:
Nikolay Kim
2018-01-29 14:44:25 -08:00
parent 6416a796c3
commit b686f39d0b
10 changed files with 474 additions and 68 deletions

View File

@@ -13,6 +13,7 @@ use server::h1::{Decoder, chunked};
use server::encoding::PayloadType;
use super::ClientResponse;
use super::response::ClientMessage;
const MAX_BUFFER_SIZE: usize = 131_072;
const MAX_HEADERS: usize = 96;
@@ -225,10 +226,16 @@ impl HttpResponseParser {
decoder: decoder,
};
Ok(Async::Ready(
(ClientResponse::new(status, version, hdrs, Some(payload)), Some(info))))
(ClientResponse::new(
ClientMessage{
status: status, version: version,
headers: hdrs, cookies: None, payload: Some(payload)}), Some(info))))
} else {
Ok(Async::Ready(
(ClientResponse::new(status, version, hdrs, None), None)))
(ClientResponse::new(
ClientMessage{
status: status, version: version,
headers: hdrs, cookies: None, payload: None}), None)))
}
}
}