Skip to content

Commit

Permalink
Switch ureq to used forked chunked_transfer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha authored and algesten committed Dec 9, 2022
1 parent 43a12cd commit 6bef9da
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ brotli = ["brotli-decompressor"]

[dependencies]
base64 = "0.13"
chunked_transfer = "1.2"
cookie = { version = "0.16", default-features = false, optional = true}
once_cell = "1"
url = "2"
Expand Down
2 changes: 1 addition & 1 deletion src/chunked/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use std::io::Result as IoResult;
///
/// # Example
///
/// ```
/// ```no_compile
/// use chunked_transfer::Decoder;
/// use std::io::Read;
///
Expand Down
2 changes: 1 addition & 1 deletion src/chunked/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::io::Write;
///
/// # Example
///
/// ```
/// ```no_compile
/// use chunked_transfer::Encoder;
/// use std::io::Write;
///
Expand Down
2 changes: 1 addition & 1 deletion src/chunked/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#![allow(dead_code)]
mod decoder;
pub use decoder::Decoder;

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@
mod agent;
mod body;
mod chunked;
mod error;
mod header;
mod middleware;
Expand Down
3 changes: 1 addition & 2 deletions src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ mod tests {
#[cfg(feature = "gzip")]
fn read_exact_chunked_gzip() {
use crate::response::Compression;
use chunked_transfer::Decoder as ChunkDecoder;
use std::io::Cursor;

let gz_body = vec![
Expand Down Expand Up @@ -476,7 +475,7 @@ mod tests {
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)> =
Box::new(PoolReturnRead::new(chunked));

Expand Down
2 changes: 1 addition & 1 deletion src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use std::num::NonZeroUsize;
use std::str::FromStr;
use std::{fmt, io::BufRead};

use chunked_transfer::Decoder as ChunkDecoder;
use log::debug;
use url::Url;

use crate::body::SizedReader;
use crate::chunked::Decoder as ChunkDecoder;
use crate::error::{Error, ErrorKind::BadStatus};
use crate::header::{get_all_headers, get_header, Header, HeaderLine};
use crate::pool::{PoolReturnRead, PoolReturner};
Expand Down
8 changes: 3 additions & 5 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ use std::time::Duration;
use std::time::Instant;
use std::{fmt, io::Cursor};

use chunked_transfer::Decoder as ChunkDecoder;

#[cfg(feature = "socks-proxy")]
use socks::{TargetAddr, ToTargetAddr};

use crate::chunked::Decoder as ChunkDecoder;
use crate::error::ErrorKind;
use crate::pool::{PoolKey, PoolReturner};
use crate::proxy::Proxy;
use crate::{error::Error, proxy::Proto};

use crate::error::ErrorKind;
use crate::unit::Unit;
use crate::{error::Error, proxy::Proto};

/// Trait for things implementing [std::io::Read] + [std::io::Write]. Used in [TlsConnector].
pub trait ReadWrite: Read + Write + Send + Sync + fmt::Debug + 'static {
Expand Down

0 comments on commit 6bef9da

Please sign in to comment.