1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-28 02:49:02 +02:00

add h1::SendResponse future; renamed to MessageBody::size

This commit is contained in:
Nikolay Kim
2019-04-10 12:24:17 -07:00
parent 046b7a1425
commit 9bb40c249f
15 changed files with 308 additions and 104 deletions

View File

@ -55,14 +55,14 @@ where
io: Some(io),
};
let len = body.length();
let len = body.size();
// create Framed and send reqest
Framed::new(io, h1::ClientCodec::default())
.send((head, len).into())
.from_err()
// send request body
.and_then(move |framed| match body.length() {
.and_then(move |framed| match body.size() {
BodySize::None | BodySize::Empty | BodySize::Sized(0) => {
Either::A(ok(framed))
}

View File

@ -27,9 +27,9 @@ where
T: AsyncRead + AsyncWrite + 'static,
B: MessageBody,
{
trace!("Sending client request: {:?} {:?}", head, body.length());
trace!("Sending client request: {:?} {:?}", head, body.size());
let head_req = head.method == Method::HEAD;
let length = body.length();
let length = body.size();
let eof = match length {
BodySize::None | BodySize::Empty | BodySize::Sized(0) => true,
_ => false,