Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
24 changes: 20 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/dht/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ librqbit-core = { path = "../librqbit_core", default-features = false, version =
chrono = { version = "0.4.31", features = ["serde"] }
tokio-util = "0.7.10"
bytes = "1.7.1"
librqbit-dualstack-sockets = "0.1.1"
librqbit-dualstack-sockets = "0.3.1"

[dev-dependencies]
tracing-subscriber = "0.3"
2 changes: 1 addition & 1 deletion crates/librqbit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ intervaltree = "0.2.7"
async-compression = { version = "0.4.18", features = ["tokio", "gzip"] }
librqbit-utp = { version = "0.4.0", features = ["export-metrics"] }
axum-extra = { version = "0.10.1", features = ["query"] }
librqbit-dualstack-sockets = { version = "0.1.1" }
librqbit-dualstack-sockets = { version = "0.3.1", features = ["axum"] }

[target.'cfg(windows)'.dependencies]
windows = { version = "0.61.1", features = [
Expand Down
13 changes: 6 additions & 7 deletions crates/librqbit/src/http_api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ use base64::Engine;
use futures::FutureExt;
use futures::future::BoxFuture;
use http::{HeaderMap, StatusCode};
use std::net::SocketAddr;
use librqbit_dualstack_sockets::TcpListener;
use std::sync::Arc;
use tokio::net::TcpListener;
use tower_http::trace::{DefaultOnFailure, DefaultOnResponse, OnFailure};
use tracing::{Span, debug, error_span, info};

Expand Down Expand Up @@ -166,11 +165,11 @@ impl HttpApi {
.make_span_with(|req: &Request| {
let method = req.method();
let uri = req.uri();
if let Some(ConnectInfo(addr)) =
req.extensions().get::<ConnectInfo<SocketAddr>>()
if let Some(ConnectInfo(addr)) = req
.extensions()
.get::<ConnectInfo<librqbit_dualstack_sockets::WrappedSocketAddr>>()
{
let addr = SocketAddr::new(addr.ip().to_canonical(), addr.port());
error_span!("request", %method, %uri, %addr)
error_span!("request", %method, %uri, addr=%addr.0)
} else {
error_span!("request", %method, %uri)
}
Expand All @@ -191,7 +190,7 @@ impl HttpApi {
}
}),
)
.into_make_service_with_connect_info::<SocketAddr>();
.into_make_service_with_connect_info::<librqbit_dualstack_sockets::WrappedSocketAddr>();

async move {
axum::serve(listener, app)
Expand Down
1 change: 1 addition & 0 deletions crates/rqbit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ signal-hook = "0.3.17"
tokio-util = "0.7.11"
gethostname = "1"
url = "2"
librqbit-dualstack-sockets = "0.3.1"

[dev-dependencies]
futures = { version = "0.3" }
Loading