From 425a408501f4f1415bfddf0619725b206a048bf9 Mon Sep 17 00:00:00 2001 From: Eric Saxby Date: Mon, 6 Nov 2023 13:42:54 -0800 Subject: [PATCH] Update cargo deps --- native/specter_nif/Cargo.lock | 357 ++++++++-------- native/specter_nif/Cargo.toml | 2 +- native/specter_nif/src/peer_connection/mod.rs | 396 ++++++++++-------- native/specter_nif/src/track.rs | 8 +- 4 files changed, 422 insertions(+), 341 deletions(-) diff --git a/native/specter_nif/Cargo.lock b/native/specter_nif/Cargo.lock index 46755fc..b49b14d 100644 --- a/native/specter_nif/Cargo.lock +++ b/native/specter_nif/Cargo.lock @@ -54,9 +54,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -108,20 +108,20 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" @@ -152,9 +152,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "base64ct" @@ -179,9 +179,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -209,9 +209,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -273,9 +273,9 @@ checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -291,9 +291,9 @@ dependencies = [ [[package]] name = "crc-catalog" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crypto-bigint" @@ -345,13 +345,13 @@ dependencies = [ [[package]] name = "curve25519-dalek-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] [[package]] @@ -387,9 +387,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] [[package]] name = "digest" @@ -411,7 +414,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] [[package]] @@ -430,9 +433,9 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.5" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" dependencies = [ "base16ct", "crypto-bigint", @@ -464,25 +467,14 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "ff" version = "0.13.0" @@ -495,9 +487,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +checksum = "a481586acf778f1b1455424c343f71124b048ffa5f4fc3f8f6ae9dc432dcb3c7" [[package]] name = "form_urlencoded" @@ -510,9 +502,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -525,9 +517,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -535,15 +527,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -552,38 +544,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -729,9 +721,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -752,9 +744,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -767,21 +759,21 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -805,9 +797,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -835,9 +827,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi", @@ -890,9 +882,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -973,9 +965,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", @@ -1033,9 +1025,9 @@ dependencies = [ [[package]] name = "platforms" -version = "3.1.2" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" [[package]] name = "polyval" @@ -1049,6 +1041,12 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1057,18 +1055,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "primeorder" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3" +checksum = "c7dbe9ed3b56368bd99483eb32fe9c17fdd3730aebadc906918ce78d54c7eeb4" dependencies = [ "elliptic-curve", ] [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -1114,12 +1112,12 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4426f9f4d65c83b570885bee479ba4c5e78d7a5286c8a58e3d2570462121b447" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" dependencies = [ "pem", - "ring", + "ring 0.16.20", "time", "x509-parser", "yasna", @@ -1127,18 +1125,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", @@ -1148,9 +1146,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -1159,9 +1157,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rfc6979" @@ -1182,12 +1180,26 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys", +] + [[package]] name = "rtcp" version = "0.10.0" @@ -1238,11 +1250,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.14" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -1251,9 +1263,9 @@ dependencies = [ [[package]] name = "rustler" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884cb623b9f43d3e2c51f9071c5e96a5acf3e6e6007866812884ff0cb983f1e" +checksum = "c4b4fea69e23de68c42c06769d6624d2d018da550c17244dd4b691f90ced4a7e" dependencies = [ "lazy_static", "rustler_codegen", @@ -1262,14 +1274,14 @@ dependencies = [ [[package]] name = "rustler_codegen" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e277af754f2560cf4c4ebedb68c1a735292fb354505c6133e47ec406e699cf" +checksum = "406061bd07aaf052c344257afed4988c5ec8efe4d2352b4c2cf27ea7c8575b12" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] [[package]] @@ -1284,24 +1296,24 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", - "ring", + "ring 0.17.5", "rustls-webpki", "sct", ] [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -1318,12 +1330,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -1354,35 +1366,35 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "a834c4821019838224821468552240d4d95d14e751986442c816572d39a080c9" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "46fa52d5646bce91b680189fe5b1c049d2ea38dabb4e2e7c8d00ca12cfbfbcfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -1402,9 +1414,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -1456,9 +1468,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -1484,6 +1496,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.7.2" @@ -1505,7 +1523,7 @@ dependencies = [ "lazy_static", "md-5", "rand", - "ring", + "ring 0.16.20", "subtle", "thiserror", "tokio", @@ -1541,9 +1559,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -1573,32 +1591,33 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] [[package]] name = "time" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -1606,15 +1625,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -1636,9 +1655,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes", @@ -1661,7 +1680,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] [[package]] @@ -1676,7 +1695,7 @@ dependencies = [ "log", "md-5", "rand", - "ring", + "ring 0.16.20", "stun", "thiserror", "tokio", @@ -1741,6 +1760,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.4.1" @@ -1754,9 +1779,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ "getrandom", ] @@ -1790,9 +1815,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1800,24 +1825,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1825,28 +1850,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -1869,7 +1894,7 @@ dependencies = [ "rand", "rcgen", "regex", - "ring", + "ring 0.16.20", "rtcp", "rtp", "rustls", @@ -1931,7 +1956,7 @@ dependencies = [ "rand", "rand_core", "rcgen", - "ring", + "ring 0.16.20", "rustls", "sec1", "serde", @@ -2177,7 +2202,7 @@ dependencies = [ "lazy_static", "nom", "oid-registry", - "ring", + "ring 0.16.20", "rusticata-macros", "thiserror", "time", @@ -2209,5 +2234,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.39", ] diff --git a/native/specter_nif/Cargo.toml b/native/specter_nif/Cargo.toml index 5e65fd8..9ee5cf6 100644 --- a/native/specter_nif/Cargo.toml +++ b/native/specter_nif/Cargo.toml @@ -14,7 +14,7 @@ crate-type = ["cdylib"] log = "0.4" env_logger = "0.10" once_cell = "1.2.0" -rustler = "0.29" +rustler = "0.30" serde_json = "1" tokio = { version = "1", features = ["full"] } uuid = { version = "1.2", features = ["v4"] } diff --git a/native/specter_nif/src/peer_connection/mod.rs b/native/specter_nif/src/peer_connection/mod.rs index 9a0da6d..2f56f62 100644 --- a/native/specter_nif/src/peer_connection/mod.rs +++ b/native/specter_nif/src/peer_connection/mod.rs @@ -623,9 +623,11 @@ fn spawn_rtc_peer_connection(resource: ResourceArc, api: Arc, uuid: St let pc = match pc.await { Err(_) => { - msg_env.send_and_clear(&pid, |env| { - (atoms::peer_connection_error(), &pc_uuid).encode(env) - }); + msg_env + .send_and_clear(&pid, |env| { + (atoms::peer_connection_error(), &pc_uuid).encode(env) + }) + .unwrap(); return; } Ok(pc) => Arc::new(pc), @@ -635,9 +637,11 @@ fn spawn_rtc_peer_connection(resource: ResourceArc, api: Arc, uuid: St let (tx, rx) = channel::(1000); let mut state = resource.0.lock().unwrap(); state.add_peer_connection(&uuid, tx); - msg_env.send_and_clear(&state.pid, |env| { - (atoms::peer_connection_ready(), &uuid).encode(env) - }); + msg_env + .send_and_clear(&state.pid, |env| { + (atoms::peer_connection_ready(), &uuid).encode(env) + }) + .unwrap(); rx }; @@ -649,10 +653,12 @@ fn spawn_rtc_peer_connection(resource: ResourceArc, api: Arc, uuid: St let candidate = c.to_json().unwrap(); let json = serde_json::to_string(&candidate).unwrap(); - msg_env.send_and_clear(&pid, |env| { - // (atoms::ice_candidate(), &uuid, json).encode(env) - (atoms::ice_candidate(), &pc_uuid, json).encode(env) - }); + msg_env + .send_and_clear(&pid, |env| { + // (atoms::ice_candidate(), &uuid, json).encode(env) + (atoms::ice_candidate(), &pc_uuid, json).encode(env) + }) + .unwrap_or(()); } }) })); @@ -667,12 +673,16 @@ fn spawn_rtc_peer_connection(resource: ResourceArc, api: Arc, uuid: St let lock = pc.clone(); let resp = lock.add_ice_candidate(candidate).await; - msg_env.send_and_clear(&pid, |env| match resp { - Err(err) => { - (atoms::candidate_error(), &pc_uuid, err.to_string()).encode(env) - } - Ok(()) => (atoms::ok(), &pc_uuid, atoms::add_ice_candidate()).encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + Err(err) => { + (atoms::candidate_error(), &pc_uuid, err.to_string()).encode(env) + } + Ok(()) => { + (atoms::ok(), &pc_uuid, atoms::add_ice_candidate()).encode(env) + } + }) + .unwrap(); } Some(Msg::AddTrack(track_uuid, track)) => { let lock = pc.clone(); @@ -680,245 +690,289 @@ fn spawn_rtc_peer_connection(resource: ResourceArc, api: Arc, uuid: St let sender_uuid = gen_uuid(); rtp_senders.insert(sender_uuid.clone(), sender); - msg_env.send_and_clear(&pid, |env| { - (atoms::rtp_sender(), &pc_uuid, &track_uuid, sender_uuid).encode(env) - }) + msg_env + .send_and_clear(&pid, |env| { + (atoms::rtp_sender(), &pc_uuid, &track_uuid, sender_uuid).encode(env) + }) + .unwrap(); } Some(Msg::CreateAnswer(opts)) => { let lock = pc.clone(); let resp = lock.create_answer(opts).await; - msg_env.send_and_clear(&pid, |env| match resp { - Err(err) => (atoms::answer_error(), &pc_uuid, err.to_string()).encode(env), - Ok(answer) => ( - atoms::answer(), - &pc_uuid, - serde_json::to_string(&answer).unwrap(), - ) - .encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + Err(err) => { + (atoms::answer_error(), &pc_uuid, err.to_string()).encode(env) + } + Ok(answer) => ( + atoms::answer(), + &pc_uuid, + serde_json::to_string(&answer).unwrap(), + ) + .encode(env), + }) + .unwrap(); } Some(Msg::CreateDataChannel(label)) => { let lock = pc.clone(); let resp = lock.create_data_channel(&label, None).await; - msg_env.send_and_clear(&pid, |env| match resp { - Err(err) => (atoms::offer_error(), &pc_uuid, err.to_string()).encode(env), - Ok(_data_channel) => (atoms::data_channel_created(), &pc_uuid).encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + Err(err) => { + (atoms::offer_error(), &pc_uuid, err.to_string()).encode(env) + } + Ok(_data_channel) => { + (atoms::data_channel_created(), &pc_uuid).encode(env) + } + }) + .unwrap(); } Some(Msg::CreateOffer(opts)) => { let lock = pc.clone(); let resp = lock.create_offer(opts).await; - msg_env.send_and_clear(&pid, |env| match resp { - Err(err) => (atoms::offer_error(), &pc_uuid, err.to_string()).encode(env), - Ok(offer) => ( - atoms::offer(), - &pc_uuid, - serde_json::to_string(&offer).unwrap(), - ) - .encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + Err(err) => { + (atoms::offer_error(), &pc_uuid, err.to_string()).encode(env) + } + Ok(offer) => ( + atoms::offer(), + &pc_uuid, + serde_json::to_string(&offer).unwrap(), + ) + .encode(env), + }) + .unwrap(); } Some(Msg::GetCurrentLocalDescription) => { let lock = pc.clone(); let resp = lock.current_local_description().await; - msg_env.send_and_clear(&pid, |env| match resp { - None => ( - atoms::current_local_description(), - &pc_uuid, - rustler::types::atom::nil(), - ) - .encode(env), - Some(desc) => ( - atoms::current_local_description(), - &pc_uuid, - serde_json::to_string(&desc).unwrap(), - ) - .encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + None => ( + atoms::current_local_description(), + &pc_uuid, + rustler::types::atom::nil(), + ) + .encode(env), + Some(desc) => ( + atoms::current_local_description(), + &pc_uuid, + serde_json::to_string(&desc).unwrap(), + ) + .encode(env), + }) + .unwrap(); } Some(Msg::GetLocalDescription) => { let lock = pc.clone(); let resp = lock.local_description().await; - msg_env.send_and_clear(&pid, |env| match resp { - None => ( - atoms::local_description(), - &pc_uuid, - rustler::types::atom::nil(), - ) - .encode(env), - Some(desc) => ( - atoms::local_description(), - &pc_uuid, - serde_json::to_string(&desc).unwrap(), - ) - .encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + None => ( + atoms::local_description(), + &pc_uuid, + rustler::types::atom::nil(), + ) + .encode(env), + Some(desc) => ( + atoms::local_description(), + &pc_uuid, + serde_json::to_string(&desc).unwrap(), + ) + .encode(env), + }) + .unwrap(); } Some(Msg::GetPendingLocalDescription) => { let lock = pc.clone(); let resp = lock.pending_local_description().await; - msg_env.send_and_clear(&pid, |env| match resp { - None => ( - atoms::pending_local_description(), - &pc_uuid, - rustler::types::atom::nil(), - ) - .encode(env), - Some(desc) => ( - atoms::pending_local_description(), - &pc_uuid, - serde_json::to_string(&desc).unwrap(), - ) - .encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + None => ( + atoms::pending_local_description(), + &pc_uuid, + rustler::types::atom::nil(), + ) + .encode(env), + Some(desc) => ( + atoms::pending_local_description(), + &pc_uuid, + serde_json::to_string(&desc).unwrap(), + ) + .encode(env), + }) + .unwrap(); } Some(Msg::GetCurrentRemoteDescription) => { let lock = pc.clone(); let resp = lock.current_remote_description().await; - msg_env.send_and_clear(&pid, |env| match resp { - None => ( - atoms::current_remote_description(), - &pc_uuid, - rustler::types::atom::nil(), - ) - .encode(env), - Some(desc) => ( - atoms::current_remote_description(), - &pc_uuid, - serde_json::to_string(&desc).unwrap(), - ) - .encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + None => ( + atoms::current_remote_description(), + &pc_uuid, + rustler::types::atom::nil(), + ) + .encode(env), + Some(desc) => ( + atoms::current_remote_description(), + &pc_uuid, + serde_json::to_string(&desc).unwrap(), + ) + .encode(env), + }) + .unwrap(); } Some(Msg::GetRemoteDescription) => { let lock = pc.clone(); let resp = lock.remote_description().await; - msg_env.send_and_clear(&pid, |env| match resp { - None => ( - atoms::remote_description(), - &pc_uuid, - rustler::types::atom::nil(), - ) - .encode(env), - Some(desc) => ( - atoms::remote_description(), - &pc_uuid, - serde_json::to_string(&desc).unwrap(), - ) - .encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + None => ( + atoms::remote_description(), + &pc_uuid, + rustler::types::atom::nil(), + ) + .encode(env), + Some(desc) => ( + atoms::remote_description(), + &pc_uuid, + serde_json::to_string(&desc).unwrap(), + ) + .encode(env), + }) + .unwrap(); } Some(Msg::GetPendingRemoteDescription) => { let lock = pc.clone(); let resp = lock.pending_remote_description().await; - msg_env.send_and_clear(&pid, |env| match resp { - None => ( - atoms::pending_remote_description(), - &pc_uuid, - rustler::types::atom::nil(), - ) - .encode(env), - Some(desc) => ( - atoms::pending_remote_description(), - &pc_uuid, - serde_json::to_string(&desc).unwrap(), - ) - .encode(env), - }); + msg_env + .send_and_clear(&pid, |env| match resp { + None => ( + atoms::pending_remote_description(), + &pc_uuid, + rustler::types::atom::nil(), + ) + .encode(env), + Some(desc) => ( + atoms::pending_remote_description(), + &pc_uuid, + serde_json::to_string(&desc).unwrap(), + ) + .encode(env), + }) + .unwrap(); } Some(Msg::GetStats) => { let lock = pc.clone(); let stats = lock.get_stats().await; - msg_env.send_and_clear(&pid, |env| { - ( - atoms::stats(), - &pc_uuid, - serde_json::to_string(&stats).unwrap(), - ) - .encode(env) - }); + msg_env + .send_and_clear(&pid, |env| { + ( + atoms::stats(), + &pc_uuid, + serde_json::to_string(&stats).unwrap(), + ) + .encode(env) + }) + .unwrap(); } Some(Msg::SetLocalDescription(session)) => { let lock = pc.clone(); let resp = lock.set_local_description(session).await; - msg_env.send_and_clear(&pid, |env| match resp { - Err(err) => ( - atoms::invalid_local_description(), - &pc_uuid, - err.to_string(), - ) - .encode(env), - Ok(_) => { - (atoms::ok(), &pc_uuid, atoms::set_local_description()).encode(env) - } - }); + msg_env + .send_and_clear(&pid, |env| match resp { + Err(err) => ( + atoms::invalid_local_description(), + &pc_uuid, + err.to_string(), + ) + .encode(env), + Ok(_) => { + (atoms::ok(), &pc_uuid, atoms::set_local_description()).encode(env) + } + }) + .unwrap(); } Some(Msg::SetRemoteDescription(session)) => { let lock = pc.clone(); let resp = lock.set_remote_description(session).await; - msg_env.send_and_clear(&pid, |env| match resp { - Err(err) => ( - atoms::invalid_remote_description(), - &pc_uuid, - err.to_string(), - ) - .encode(env), - Ok(_) => { - (atoms::ok(), &pc_uuid, atoms::set_remote_description()).encode(env) - } - }); + msg_env + .send_and_clear(&pid, |env| match resp { + Err(err) => ( + atoms::invalid_remote_description(), + &pc_uuid, + err.to_string(), + ) + .encode(env), + Ok(_) => { + (atoms::ok(), &pc_uuid, atoms::set_remote_description()).encode(env) + } + }) + .unwrap(); } Some(Msg::IceConnectionState) => { let lock = pc.clone(); let resp = lock.ice_connection_state(); let state = peer_conn_state::IceConnectionState::from(&resp); - msg_env.send_and_clear(&pid, |env| { - (atoms::ice_connection_state(), &pc_uuid, state).encode(env) - }); + msg_env + .send_and_clear(&pid, |env| { + (atoms::ice_connection_state(), &pc_uuid, state).encode(env) + }) + .unwrap(); } Some(Msg::IceGatheringState) => { let lock = pc.clone(); let resp = lock.ice_gathering_state(); let state = peer_conn_state::IceGatheringState::from(&resp); - msg_env.send_and_clear(&pid, |env| { - (atoms::ice_gathering_state(), &pc_uuid, state).encode(env) - }); + msg_env + .send_and_clear(&pid, |env| { + (atoms::ice_gathering_state(), &pc_uuid, state).encode(env) + }) + .unwrap(); } Some(Msg::SignalingState) => { let lock = pc.clone(); let resp = lock.signaling_state(); let state = peer_conn_state::SignalingState::from(&resp); - msg_env.send_and_clear(&pid, |env| { - (atoms::signaling_state(), &pc_uuid, state).encode(env) - }); + msg_env + .send_and_clear(&pid, |env| { + (atoms::signaling_state(), &pc_uuid, state).encode(env) + }) + .unwrap(); } Some(Msg::ConnectionState) => { let lock = pc.clone(); let resp = lock.connection_state(); let state = peer_conn_state::ConnectionState::from(&resp); - msg_env.send_and_clear(&pid, |env| { - (atoms::connection_state(), &pc_uuid, state).encode(env) - }); + msg_env + .send_and_clear(&pid, |env| { + (atoms::connection_state(), &pc_uuid, state).encode(env) + }) + .unwrap(); } None => break, - } + }; } let state = resource.0.lock().unwrap(); - msg_env.send_and_clear(&state.pid, |env| { - (atoms::peer_connection_closed(), &pc_uuid).encode(env) - }); + msg_env + .send_and_clear(&state.pid, |env| { + (atoms::peer_connection_closed(), &pc_uuid).encode(env) + }) + .unwrap(); }); } diff --git a/native/specter_nif/src/track.rs b/native/specter_nif/src/track.rs index e6fcabf..b56e43b 100644 --- a/native/specter_nif/src/track.rs +++ b/native/specter_nif/src/track.rs @@ -48,9 +48,11 @@ pub fn play_from_file_h264<'a>( Ok(nal) => nal, Err(err) => { log::debug!("All video frames parsed and sent: {:?}\r", err); - msg_env.send_and_clear(&pid, |env| { - (atoms::playback_finished(), &decoded_track_uuid).encode(env) - }); + msg_env + .send_and_clear(&pid, |env| { + (atoms::playback_finished(), &decoded_track_uuid).encode(env) + }) + .unwrap(); break; } };