1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 08:45:10 +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

@ -320,7 +320,7 @@ where
body: ResponseBody<B>,
) -> Result<State<S, B, X>, DispatchError> {
self.codec
.encode(Message::Item((message, body.length())), &mut self.write_buf)
.encode(Message::Item((message, body.size())), &mut self.write_buf)
.map_err(|err| {
if let Some(mut payload) = self.payload.take() {
payload.set_error(PayloadError::Incomplete(None));
@ -329,7 +329,7 @@ where
})?;
self.flags.set(Flags::KEEPALIVE, self.codec.keepalive());
match body.length() {
match body.size() {
BodySize::None | BodySize::Empty => Ok(State::None),
_ => Ok(State::SendPayload(body)),
}