feat(io): `TokioIo<T>: PeerAddr`
Signed-off-by: katelyn martin <kate@buoyant.io>
This commit is contained in:
parent
28274d2bfc
commit
afb351fd14
|
|
@ -1995,6 +1995,7 @@ dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures",
|
"futures",
|
||||||
|
"hyper-util",
|
||||||
"linkerd-errno",
|
"linkerd-errno",
|
||||||
"pin-project",
|
"pin-project",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ default = []
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
futures = { version = "0.3", default-features = false }
|
futures = { version = "0.3", default-features = false }
|
||||||
bytes = { workspace = true }
|
bytes = { workspace = true }
|
||||||
|
hyper-util = { workspace = true, features = ["tokio"] }
|
||||||
linkerd-errno = { path = "../errno" }
|
linkerd-errno = { path = "../errno" }
|
||||||
tokio = { version = "1", features = ["io-util", "net"] }
|
tokio = { version = "1", features = ["io-util", "net"] }
|
||||||
tokio-test = { version = "0.4", optional = true }
|
tokio-test = { version = "0.4", optional = true }
|
||||||
|
|
|
||||||
|
|
@ -76,3 +76,10 @@ impl PeerAddr for tokio::io::DuplexStream {
|
||||||
Ok(([0, 0, 0, 0], 0).into())
|
Ok(([0, 0, 0, 0], 0).into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T: PeerAddr> PeerAddr for hyper_util::rt::tokio::TokioIo<T> {
|
||||||
|
#[inline]
|
||||||
|
fn peer_addr(&self) -> Result<SocketAddr> {
|
||||||
|
self.inner().peer_addr()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue