From 8115707cbe86d580269cc6332b0d212a46a2954d Mon Sep 17 00:00:00 2001 From: Mnwa Date: Mon, 12 Oct 2020 13:02:27 +0300 Subject: [PATCH] Use smallvec --- Cargo.lock | 3 ++- Cargo.toml | 2 +- src/client/stream.rs | 2 +- src/server/udp.rs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2353bd5..c5da9d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1726,8 +1726,9 @@ dependencies = [ [[package]] name = "srtp" version = "0.6.0" -source = "git+https://github.com/Mnwa/srtp?branch=vec#ebe8afea5c917642b01377be4f554a69cb7e78e3" +source = "git+https://github.com/Mnwa/srtp#6655fd232d2b903cf4c07e6325f13296aa74bd95" dependencies = [ + "smallvec", "srtp2-sys", ] diff --git a/Cargo.toml b/Cargo.toml index fe20a8b..aba09a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ crc32fast = "1.2" actix = "0.10.0" actix-rt = "1" tokio-openssl = "0.4" -srtp = { git = "https://github.com/Mnwa/srtp", branch = "vec" } +srtp = { git = "https://github.com/Mnwa/srtp", branch = "master" } actix-web = "3" actix-files = "0.4" smallvec = "1.4" diff --git a/src/client/stream.rs b/src/client/stream.rs index 82a3d54..d5ff6f5 100644 --- a/src/client/stream.rs +++ b/src/client/stream.rs @@ -120,7 +120,7 @@ impl AsyncWrite for ClientSslPackets { match self .get_mut() .outgoing_writer - .send(DataPacket::from_slice(buf)) + .send(DataPacket::from(buf)) .poll_unpin(cx) { Poll::Ready(Ok(_)) => Poll::Ready(Ok(buf.len())), diff --git a/src/server/udp.rs b/src/server/udp.rs index 501c02f..84c41ba 100644 --- a/src/server/udp.rs +++ b/src/server/udp.rs @@ -341,4 +341,4 @@ impl Future for UdpMassSender { } } -pub type DataPacket = SmallVec<[u8; 512]>; +pub type DataPacket = SmallVec<[u8; 2048]>;