diff --git a/Cargo.lock b/Cargo.lock index 3c1ff8f..5aff387 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,47 +89,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -226,9 +227,9 @@ checksum = "9ae037714f313c1353189ead58ef9eec30a8e8dc101b2622d461418fd59e28a9" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -502,9 +503,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "comfy-table" @@ -1172,6 +1173,12 @@ dependencies = [ "libc", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itoa" version = "1.0.11" @@ -1543,9 +1550,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -2373,7 +2380,7 @@ checksum = "1e0e61cd21fbddd85fbd9367b775660a01d388c08a61c6d2824af480b0309bb9" [[package]] name = "rtp" version = "0.1.0" -source = "git+https://github.com/Banyc/rtp.git?tag=v0.0.36#c80ed0ad7aebcb5ce529e9628602d762f81b292a" +source = "git+https://github.com/Banyc/rtp.git?tag=v0.0.38#4384ffc2e831e1eee6dfadfc351a54427cd0a5de" dependencies = [ "async-trait", "async_async_io", @@ -2439,9 +2446,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96560eea317a9cc4e0bb1f6a2c93c09a19b8c4fc5cb3fcc0ec1c094cd783e2" +checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" dependencies = [ "sdd", ] @@ -3148,7 +3155,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "udp_listener" version = "0.1.0" -source = "git+https://github.com/Banyc/udp_listener.git?tag=v0.0.8#e268469c6005a76dd5e181fd8240bc6539c8e6fb" +source = "git+https://github.com/Banyc/udp_listener.git?tag=v0.0.9#2a39a0a9c5cfafba81179aa1ebdda1fcfc2c3028" dependencies = [ "bytes", "lockfree-object-pool", diff --git a/Cargo.toml b/Cargo.toml index f59720d..56adf60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ once_cell = "1" pin-project-lite = "0.2" rand = "0.8" regex = "1" -rtp = { git = "https://github.com/Banyc/rtp.git", tag = "v0.0.36" } +rtp = { git = "https://github.com/Banyc/rtp.git", tag = "v0.0.38" } scopeguard = "1" serde = "1" serde_json = "1" @@ -60,7 +60,7 @@ tokio_throughput = { git = "https://github.com/Banyc/tokio_throughput.git", rev toml = "0.8" tracing = "0.1" tracing-subscriber = "0.3" -udp_listener = { git = "https://github.com/Banyc/udp_listener.git", tag = "v0.0.8" } +udp_listener = { git = "https://github.com/Banyc/udp_listener.git", tag = "v0.0.9" } [profile.profiling] inherits = "release" diff --git a/protocol/src/stream/streams/rtp.rs b/protocol/src/stream/streams/rtp.rs index ac2bc55..8b7c729 100644 --- a/protocol/src/stream/streams/rtp.rs +++ b/protocol/src/stream/streams/rtp.rs @@ -9,6 +9,7 @@ use tokio::{ use tracing::{error, info, instrument, trace, warn}; use common::{ + addr::any_addr, error::AnyResult, loading, stream::{connect::StreamConnect, IoAddr, IoStream, StreamServerHook}, @@ -84,7 +85,7 @@ where }; let stream = AddressedRtpStream { read: accepted.read.into_async_read(), - write: accepted.write.into_async_write(true), + write: accepted.write.into_async_write(), local_addr: self.listener.local_addr(), peer_addr: accepted.peer_addr, }; @@ -125,10 +126,11 @@ pub struct RtpConnector; impl StreamConnect for RtpConnector { type Connection = Connection; async fn connect(&self, addr: SocketAddr) -> io::Result { - let connected = rtp::udp::connect_without_handshake(addr, None).await?; + let connected = + rtp::udp::connect_without_handshake(any_addr(&addr.ip()), addr, None).await?; let stream = AddressedRtpStream { read: connected.read.into_async_read(), - write: connected.write.into_async_write(true), + write: connected.write.into_async_write(), local_addr: connected.local_addr, peer_addr: connected.peer_addr, };