Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
430 changes: 425 additions & 5 deletions Cargo-minimal.lock

Large diffs are not rendered by default.

430 changes: 425 additions & 5 deletions Cargo-recent.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions bitreq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ log = { version = "0.4.0", default-features = false, optional = true }
[dev-dependencies]
tiny_http = "0.12"
tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread", "time"] }
proptest = { version = "1.5", default-features = false, features = ["std"] }
url = { version = "2", default-features = false }

[package.metadata.docs.rs]
features = ["json-using-serde", "proxy", "https"]
Expand Down
12 changes: 6 additions & 6 deletions bitreq/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ impl AsyncConnection {
// do proxy things
let mut tcp = Self::tcp_connect(&proxy.server, proxy.port).await?;

let proxy_request = proxy.connect(params.host, params.port.port());
let proxy_request = proxy.connect(params.host, params.port);
tcp.write_all(proxy_request.as_bytes()).await?;
tcp.flush().await?;

Expand Down Expand Up @@ -347,11 +347,11 @@ impl AsyncConnection {

Ok(tcp)
}
None => Self::tcp_connect(params.host, params.port.port()).await,
None => Self::tcp_connect(params.host, params.port).await,
}

#[cfg(not(feature = "proxy"))]
Self::tcp_connect(&params.host, params.port.port()).await
Self::tcp_connect(&params.host, params.port).await
}

async fn timeout<O, F: Future<Output = O>>(timeout: Option<Instant>, f: F) -> Result<O, Error> {
Expand Down Expand Up @@ -678,7 +678,7 @@ impl Connection {
// do proxy things
let mut tcp = Self::tcp_connect(&proxy.server, proxy.port, timeout_at)?;

write!(tcp, "{}", proxy.connect(params.host, params.port.port()))?;
write!(tcp, "{}", proxy.connect(params.host, params.port))?;
tcp.flush()?;

// Max proxy response size to prevent unbounded memory allocation
Expand Down Expand Up @@ -706,11 +706,11 @@ impl Connection {

Ok(tcp)
}
None => Self::tcp_connect(params.host, params.port.port(), timeout_at),
None => Self::tcp_connect(params.host, params.port, timeout_at),
}

#[cfg(not(feature = "proxy"))]
Self::tcp_connect(params.host, params.port.port(), timeout_at)
Self::tcp_connect(params.host, params.port, timeout_at)
}

/// Sends the [`Request`](struct.Request.html), consumes this
Expand Down
213 changes: 0 additions & 213 deletions bitreq/src/http_url.rs

This file was deleted.

3 changes: 2 additions & 1 deletion bitreq/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ mod client;
#[cfg(feature = "std")]
mod connection;
mod error;
mod http_url;
#[cfg(feature = "proxy")]
mod proxy;
mod request;
mod response;
mod url;

#[cfg(feature = "async")]
pub use client::{Client, RequestExt};
Expand All @@ -269,3 +269,4 @@ pub use request::*;
pub use response::Response;
#[cfg(feature = "std")]
pub use response::ResponseLazy;
pub use url::{ParseError as UrlParseError, Url};
Loading
Loading