Switch ureq to used forked chunked_transfer.
This commit is contained in:
committed by
Martin Algesten
parent
43a12cdf51
commit
6bef9daa8e
@@ -27,7 +27,6 @@ brotli = ["brotli-decompressor"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
base64 = "0.13"
|
base64 = "0.13"
|
||||||
chunked_transfer = "1.2"
|
|
||||||
cookie = { version = "0.16", default-features = false, optional = true}
|
cookie = { version = "0.16", default-features = false, optional = true}
|
||||||
once_cell = "1"
|
once_cell = "1"
|
||||||
url = "2"
|
url = "2"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ use std::io::Result as IoResult;
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```no_compile
|
||||||
/// use chunked_transfer::Decoder;
|
/// use chunked_transfer::Decoder;
|
||||||
/// use std::io::Read;
|
/// use std::io::Read;
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ use std::io::Write;
|
|||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```no_compile
|
||||||
/// use chunked_transfer::Encoder;
|
/// use chunked_transfer::Encoder;
|
||||||
/// use std::io::Write;
|
/// use std::io::Write;
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
#![allow(dead_code)]
|
||||||
mod decoder;
|
mod decoder;
|
||||||
pub use decoder::Decoder;
|
pub use decoder::Decoder;
|
||||||
|
|
||||||
|
|||||||
@@ -346,6 +346,7 @@
|
|||||||
|
|
||||||
mod agent;
|
mod agent;
|
||||||
mod body;
|
mod body;
|
||||||
|
mod chunked;
|
||||||
mod error;
|
mod error;
|
||||||
mod header;
|
mod header;
|
||||||
mod middleware;
|
mod middleware;
|
||||||
|
|||||||
@@ -448,7 +448,6 @@ mod tests {
|
|||||||
#[cfg(feature = "gzip")]
|
#[cfg(feature = "gzip")]
|
||||||
fn read_exact_chunked_gzip() {
|
fn read_exact_chunked_gzip() {
|
||||||
use crate::response::Compression;
|
use crate::response::Compression;
|
||||||
use chunked_transfer::Decoder as ChunkDecoder;
|
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
|
|
||||||
let gz_body = vec![
|
let gz_body = vec![
|
||||||
@@ -476,7 +475,7 @@ mod tests {
|
|||||||
PoolReturner::new(agent.clone(), PoolKey::from_parts("http", "1.1.1.1", 8080)),
|
PoolReturner::new(agent.clone(), PoolKey::from_parts("http", "1.1.1.1", 8080)),
|
||||||
);
|
);
|
||||||
|
|
||||||
let chunked = ChunkDecoder::new(stream);
|
let chunked = crate::chunked::Decoder::new(stream);
|
||||||
let pool_return_read: Box<(dyn Read + Send + Sync + 'static)> =
|
let pool_return_read: Box<(dyn Read + Send + Sync + 'static)> =
|
||||||
Box::new(PoolReturnRead::new(chunked));
|
Box::new(PoolReturnRead::new(chunked));
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ use std::num::NonZeroUsize;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::{fmt, io::BufRead};
|
use std::{fmt, io::BufRead};
|
||||||
|
|
||||||
use chunked_transfer::Decoder as ChunkDecoder;
|
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::body::SizedReader;
|
use crate::body::SizedReader;
|
||||||
|
use crate::chunked::Decoder as ChunkDecoder;
|
||||||
use crate::error::{Error, ErrorKind::BadStatus};
|
use crate::error::{Error, ErrorKind::BadStatus};
|
||||||
use crate::header::{get_all_headers, get_header, Header, HeaderLine};
|
use crate::header::{get_all_headers, get_header, Header, HeaderLine};
|
||||||
use crate::pool::{PoolReturnRead, PoolReturner};
|
use crate::pool::{PoolReturnRead, PoolReturner};
|
||||||
|
|||||||
@@ -6,17 +6,15 @@ use std::time::Duration;
|
|||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use std::{fmt, io::Cursor};
|
use std::{fmt, io::Cursor};
|
||||||
|
|
||||||
use chunked_transfer::Decoder as ChunkDecoder;
|
|
||||||
|
|
||||||
#[cfg(feature = "socks-proxy")]
|
#[cfg(feature = "socks-proxy")]
|
||||||
use socks::{TargetAddr, ToTargetAddr};
|
use socks::{TargetAddr, ToTargetAddr};
|
||||||
|
|
||||||
|
use crate::chunked::Decoder as ChunkDecoder;
|
||||||
|
use crate::error::ErrorKind;
|
||||||
use crate::pool::{PoolKey, PoolReturner};
|
use crate::pool::{PoolKey, PoolReturner};
|
||||||
use crate::proxy::Proxy;
|
use crate::proxy::Proxy;
|
||||||
use crate::{error::Error, proxy::Proto};
|
|
||||||
|
|
||||||
use crate::error::ErrorKind;
|
|
||||||
use crate::unit::Unit;
|
use crate::unit::Unit;
|
||||||
|
use crate::{error::Error, proxy::Proto};
|
||||||
|
|
||||||
/// Trait for things implementing [std::io::Read] + [std::io::Write]. Used in [TlsConnector].
|
/// Trait for things implementing [std::io::Read] + [std::io::Write]. Used in [TlsConnector].
|
||||||
pub trait ReadWrite: Read + Write + Send + Sync + fmt::Debug + 'static {
|
pub trait ReadWrite: Read + Write + Send + Sync + fmt::Debug + 'static {
|
||||||
|
|||||||
Reference in New Issue
Block a user