From cc6e0c6d04e868e284c45b9ec38f1cc1fe98ac39 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Thu, 28 Mar 2019 20:40:25 -0700 Subject: [PATCH] Fix client payload decompression #674 --- CHANGES.md | 5 ++++- Cargo.toml | 2 +- src/client/pipeline.rs | 9 +++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e78ef4fc4..b716fdb21 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ # Changes -## [x.x.xx] - xxxx-xx-xx +## [0.7.19] - 2019-03-29 ### Added @@ -22,6 +22,9 @@ * Fix never-ending HTTP2 request when response is empty (#709). #737 +* Fix client payload decompression #674 + + ## [0.7.18] - 2019-01-10 ### Added diff --git a/Cargo.toml b/Cargo.toml index bd3cb306c..b6f9a8c92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-web" -version = "0.7.18" +version = "0.7.19" authors = ["Nikolay Kim "] description = "Actix web is a simple, pragmatic and extremely fast web framework for Rust." readme = "README.md" diff --git a/src/client/pipeline.rs b/src/client/pipeline.rs index 1dbd2e171..665282461 100644 --- a/src/client/pipeline.rs +++ b/src/client/pipeline.rs @@ -6,8 +6,8 @@ use std::time::{Duration, Instant}; use std::{io, mem}; use tokio_timer::Delay; -use actix_inner::dev::Request; use actix::{Addr, SystemService}; +use actix_inner::dev::Request; use super::{ ClientConnector, ClientConnectorError, ClientRequest, ClientResponse, Connect, @@ -88,7 +88,8 @@ impl SendRequest { } pub(crate) fn with_connector( - req: ClientRequest, conn: Addr, + req: ClientRequest, + conn: Addr, ) -> SendRequest { SendRequest { req, @@ -363,11 +364,11 @@ impl Pipeline { if let Some(ref mut decompress) = self.decompress { match decompress.feed_data(b) { Ok(Some(b)) => return Ok(Async::Ready(Some(b))), - Ok(None) => return Ok(Async::NotReady), + Ok(None) => continue, Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => { - continue + continue; } Err(err) => return Err(err.into()), }