diff --git a/Cargo.lock b/Cargo.lock index 8425a34..3b1fbaf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -50,10 +50,16 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.69" +name = "anes" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "aquatic" @@ -122,7 +128,7 @@ dependencies = [ "serde", "signal-hook", "slab", - "socket2", + "socket2 0.5.1", ] [[package]] @@ -147,37 +153,11 @@ dependencies = [ "serde", ] -[[package]] -name = "aquatic_http_private" -version = "0.8.0" -dependencies = [ - "anyhow", - "aquatic_common", - "aquatic_http_protocol", - "aquatic_toml_config", - "axum", - "dotenv", - "futures-util", - "hex", - "hyper", - "log", - "mimalloc", - "rand", - "rustls", - "serde", - "signal-hook", - "socket2", - "sqlx", - "tokio", - "tokio-rustls", -] - [[package]] name = "aquatic_http_protocol" version = "0.8.0" dependencies = [ "anyhow", - "axum", "bendy", "compact_str", "criterion", @@ -210,7 +190,7 @@ version = "0.8.0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -223,7 +203,7 @@ dependencies = [ "aquatic_udp_protocol", "blake3", "cfg-if", - "constant_time_eq 0.2.5", + "constant_time_eq", "crossbeam-channel", "getrandom", "hashbrown 0.13.2", @@ -243,7 +223,7 @@ dependencies = [ "serde", "signal-hook", "slab", - "socket2", + "socket2 0.5.1", "time", "tinytemplate", ] @@ -282,7 +262,7 @@ dependencies = [ "rand", "rand_distr", "serde", - "socket2", + "socket2 0.5.1", ] [[package]] @@ -324,7 +304,7 @@ dependencies = [ "serde", "signal-hook", "slab", - "socket2", + "socket2 0.5.1", "tungstenite", ] @@ -375,9 +355,9 @@ checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" @@ -385,22 +365,11 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" -[[package]] -name = "async-trait" -version = "0.1.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-tungstenite" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6acf7e4a267eecbb127ed696bb2d50572c22ba7f586a646321e1798d8336a1" +checksum = "1e0388bb7a400072bbb41ceb75d65c3baefb2ea99672fa22e85278452cd9b58b" dependencies = [ "futures-io", "futures-util", @@ -409,15 +378,6 @@ dependencies = [ "tungstenite", ] -[[package]] -name = "atoi" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c57d12312ff59c811c0643f4d80830505833c9ffaebd193d819392b265be8e" -dependencies = [ - "num-traits", -] - [[package]] name = "atty" version = "0.2.14" @@ -435,52 +395,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "axum" -version = "0.5.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" -dependencies = [ - "async-trait", - "axum-core", - "bitflags 1.3.2", - "bytes", - "futures-util", - "headers", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "serde", - "sync_wrapper", - "tokio", - "tower", - "tower-http", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "tower-layer", - "tower-service", -] - [[package]] name = "backtrace" version = "0.3.67" @@ -508,12 +422,6 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bendy" version = "0.4.0-beta.2" @@ -546,16 +454,16 @@ checksum = "703642b98a00b3b90513279a8ede3fcfa479c126c5fb46e78f3051522f021403" [[package]] name = "blake3" -version = "1.2.0" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "526c210b4520e416420759af363083471656e819a75e831b8d2c9d5a584f2413" +checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", - "constant_time_eq 0.1.5", - "digest 0.9.0", + "constant_time_eq", + "digest", ] [[package]] @@ -625,14 +533,51 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "clap" -version = "2.34.0" +name = "ciborium" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" + +[[package]] +name = "ciborium-ll" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ "bitflags 1.3.2", + "clap_lex", + "indexmap", "textwrap", - "unicode-width", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", ] [[package]] @@ -682,18 +627,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "constant_time_eq" version = "0.2.5" @@ -702,28 +635,13 @@ checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" dependencies = [ "libc", ] -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" - [[package]] name = "crc32fast" version = "1.3.2" @@ -735,15 +653,16 @@ dependencies = [ [[package]] name = "criterion" -version = "0.3.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" dependencies = [ + "anes", "atty", "cast", + "ciborium", "clap", "criterion-plot", - "csv", "itertools", "lazy_static", "num-traits", @@ -752,7 +671,6 @@ dependencies = [ "rayon", "regex", "serde", - "serde_cbor", "serde_derive", "serde_json", "tinytemplate", @@ -761,9 +679,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", "itertools", @@ -785,9 +703,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if", "crossbeam-utils", @@ -836,16 +754,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crypto-bigint" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -856,55 +764,15 @@ dependencies = [ "typenum", ] -[[package]] -name = "csv" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b015497079b9a9d69c02ad25de6c0a6edef051ea6360a327d0bd05802ef64ad" -dependencies = [ - "csv-core", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" -dependencies = [ - "memchr", -] - -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid", - "crypto-bigint", - "pem-rfc7468", -] - [[package]] name = "digest" -version = "0.9.0" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer", "crypto-common", + "subtle", ] [[package]] @@ -913,23 +781,11 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "dotenv" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" - -[[package]] -name = "dotenvy" -version = "0.15.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" - [[package]] name = "duplicate" -version = "0.4.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a4be4cd710e92098de6ad258e6e7c24af11c29c5142f3c6f2a545652480ff8" +checksum = "de78e66ac9061e030587b2a2e75cc88f22304913c907b11307bca737141230cb" dependencies = [ "heck", "proc-macro-error", @@ -984,12 +840,6 @@ dependencies = [ "libc", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "fastrand" version = "1.9.0" @@ -1028,7 +878,7 @@ dependencies = [ "futures-sink", "nanorand", "pin-project", - "spin 0.9.6", + "spin 0.9.8", ] [[package]] @@ -1048,9 +898,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -1063,9 +913,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -1073,43 +923,32 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", "futures-util", ] -[[package]] -name = "futures-intrusive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a604f7a68fbf8103337523b1fadc8ade7361ee3f112f7c680ad179651616aed5" -dependencies = [ - "futures-core", - "lock_api", - "parking_lot 0.11.2", -] - [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ "fastrand", "futures-core", @@ -1122,43 +961,42 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] name = "futures-rustls" -version = "0.22.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" +checksum = "35bd3cf68c183738046838e300353e4716c674dc5e56890de4826801a6622a28" dependencies = [ "futures-io", "rustls", - "webpki", ] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -1174,9 +1012,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1184,9 +1022,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "js-sys", @@ -1220,7 +1058,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "time", ] @@ -1254,7 +1092,7 @@ dependencies = [ "signal-hook", "sketches-ddsketch 0.1.3", "smallvec", - "socket2", + "socket2 0.4.9", "tracing", "typenum", ] @@ -1294,15 +1132,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hashlink" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" -dependencies = [ - "hashbrown 0.12.3", -] - [[package]] name = "hdrhistogram" version = "7.5.2" @@ -1317,39 +1146,11 @@ dependencies = [ "num-traits", ] -[[package]] -name = "headers" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] [[package]] name = "hermit-abi" @@ -1397,12 +1198,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - [[package]] name = "httparse" version = "1.8.0" @@ -1446,7 +1241,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1465,9 +1260,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", @@ -1505,9 +1300,9 @@ dependencies = [ [[package]] name = "io-uring" -version = "0.5.13" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1e1a01cfb924fd8c5c43b6827965db394f5a3a16c599ce03452266e1cf984c" +checksum = "8b7b36074613a723279637061b40db993208908a94f10ccb14436ce735bc0f57" dependencies = [ "bitflags 1.3.2", "libc", @@ -1515,9 +1310,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "itertools" @@ -1558,15 +1353,12 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] [[package]] name = "libc" -version = "0.2.140" +version = "0.2.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" [[package]] name = "libm" @@ -1576,9 +1368,9 @@ checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" [[package]] name = "libmimalloc-sys" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8c7cbf8b89019683667e347572e6d55a7df7ea36b0c4ce69961b0cde67b174" +checksum = "43a558e3d911bc3c7bfc8c78bc580b404d6e51c1cefbf656e176a94b49b0df40" dependencies = [ "cc", "libc", @@ -1621,12 +1413,6 @@ dependencies = [ "libc", ] -[[package]] -name = "matchit" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" - [[package]] name = "memchr" version = "2.5.0" @@ -1682,7 +1468,7 @@ dependencies = [ "ipnet", "metrics", "metrics-util", - "parking_lot 0.12.1", + "parking_lot", "portable-atomic", "quanta", "thiserror", @@ -1697,7 +1483,7 @@ checksum = "731f8ecebd9f3a4aa847dfe75455e4757a45da40a7793d2f0b1f9b6ed18b23f3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1711,7 +1497,7 @@ dependencies = [ "hashbrown 0.12.3", "metrics", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "portable-atomic", "quanta", "sketches-ddsketch 0.2.0", @@ -1719,19 +1505,13 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.34" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcb174b18635f7561a0c6c9fc2ce57218ac7523cf72c50af80e2d79ab8f3ba1" +checksum = "3d88dad3f985ec267a3fcb7a1726f5cb1a7e8cad8b646e70a84f967210df23da" dependencies = [ "libmimalloc-sys", ] -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1822,34 +1602,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2399c9463abc5f909349d8aa9ba080e0b88b3ce2885389b60b993f39b1a56905" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - [[package]] name = "num-format" version = "0.4.4" @@ -1937,6 +1689,12 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + [[package]] name = "owned-alloc" version = "0.2.0" @@ -1945,20 +1703,9 @@ checksum = "30fceb411f9a12ff9222c5f824026be368ff15dc2f13468d850c7d3f502205d6" [[package]] name = "parking" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "parking_lot" @@ -1967,21 +1714,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.7", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", + "parking_lot_core", ] [[package]] @@ -1997,21 +1730,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "paste" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" - -[[package]] -name = "pem-rfc7468" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.2.0" @@ -2035,7 +1753,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2050,28 +1768,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs1" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320" -dependencies = [ - "der", - "pkcs8", - "zeroize", -] - -[[package]] -name = "pkcs8" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" -dependencies = [ - "der", - "spki", - "zeroize", -] - [[package]] name = "pkg-config" version = "0.3.26" @@ -2137,7 +1833,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -2154,9 +1850,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -2196,7 +1892,7 @@ checksum = "b22a693222d716a9587786f37ac3f6b4faedb5b80c23914e7303ff5a1d8016e9" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2290,9 +1986,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -2301,9 +1997,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "ring" @@ -2329,42 +2025,22 @@ dependencies = [ "libc", ] -[[package]] -name = "rsa" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" -dependencies = [ - "byteorder", - "digest 0.10.5", - "num-bigint-dig", - "num-integer", - "num-iter", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core", - "smallvec", - "subtle", - "zeroize", -] - [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b" [[package]] name = "rustls" -version = "0.20.8" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "07180898a28ed6a7f7ba2311594308f595e3dd2e3c3812fa0a80a47b45f17e5d" dependencies = [ "log", "ring", + "rustls-webpki", "sct", - "webpki", ] [[package]] @@ -2376,6 +2052,16 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.12" @@ -2421,9 +2107,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.156" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" +checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" dependencies = [ "serde_derive", ] @@ -2447,32 +2133,22 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - [[package]] name = "serde_derive" -version = "1.0.156" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" +checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" dependencies = [ "itoa", "ryu", @@ -2487,18 +2163,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.5", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.5", + "digest", ] [[package]] @@ -2541,9 +2206,9 @@ checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" [[package]] name = "simple_logger" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e190a521c2044948158666916d9e872cbb9984f755e9bb3b5b75a836205affcd" +checksum = "e78beb34673091ccf96a8816fce8bfd30d1292c7621ca2bcb5f2ba0fae4f558d" dependencies = [ "atty", "colored", @@ -2598,7 +2263,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2611,6 +2276,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "socket2" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc8d618c6641ae355025c449427f9e96b98abf99a772be3cef6708d15c77147a" +dependencies = [ + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -2619,144 +2294,24 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" -version = "0.9.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d6e0250b93c8427a177b849d144a96d5acc57006149479403d7861ab721e34" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" dependencies = [ "lock_api", ] -[[package]] -name = "spki" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "sqlformat" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c12bc9199d1db8234678b7051747c07f517cdcf019262d1847b94ec8b1aee3e" -dependencies = [ - "itertools", - "nom", - "unicode_categories", -] - -[[package]] -name = "sqlx" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9249290c05928352f71c077cc44a464d880c63f26f7534728cca008e135c0428" -dependencies = [ - "sqlx-core", - "sqlx-macros", -] - -[[package]] -name = "sqlx-core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105" -dependencies = [ - "ahash 0.7.6", - "atoi", - "bitflags 1.3.2", - "byteorder", - "bytes", - "crc", - "crossbeam-queue", - "digest 0.10.5", - "dotenvy", - "either", - "event-listener", - "futures-channel", - "futures-core", - "futures-intrusive", - "futures-util", - "generic-array", - "hashlink", - "hex", - "indexmap", - "itoa", - "libc", - "log", - "memchr", - "num-bigint", - "once_cell", - "paste", - "percent-encoding", - "rand", - "rsa", - "rustls", - "rustls-pemfile", - "sha1", - "sha2", - "smallvec", - "sqlformat", - "sqlx-rt", - "stringprep", - "thiserror", - "tokio-stream", - "url", - "webpki-roots", -] - -[[package]] -name = "sqlx-macros" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b850fa514dc11f2ee85be9d055c512aa866746adfacd1cb42d867d68e6a5b0d9" -dependencies = [ - "dotenvy", - "either", - "heck", - "once_cell", - "proc-macro2", - "quote", - "sha2", - "sqlx-core", - "sqlx-rt", - "syn", - "url", -] - -[[package]] -name = "sqlx-rt" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c5b2d25fa654cc5f841750b8e1cdedbe21189bf9a9382ee90bfa9dd3562396" -dependencies = [ - "once_cell", - "tokio", - "tokio-rustls", -] - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stringprep" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "subtle" -version = "2.5.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" @@ -2770,38 +2325,40 @@ dependencies = [ ] [[package]] -name = "sync_wrapper" -version = "0.1.2" +name = "syn" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" dependencies = [ - "unicode-width", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "thiserror" -version = "1.0.39" +name = "textwrap" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.13", ] [[package]] @@ -2860,57 +2417,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg", - "bytes", "libc", - "memchr", "mio", - "num_cpus", - "parking_lot 0.12.1", "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", + "socket2 0.4.9", "windows-sys 0.45.0", ] -[[package]] -name = "tokio-macros" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls", - "tokio", - "webpki", -] - -[[package]] -name = "tokio-stream" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - [[package]] name = "toml" version = "0.5.11" @@ -2920,47 +2438,6 @@ dependencies = [ "serde", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" -dependencies = [ - "bitflags 1.3.2", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" version = "0.3.2" @@ -2974,7 +2451,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2988,7 +2464,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3033,9 +2509,9 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" -version = "0.3.12" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d502c968c6a838ead8e69b2ee18ec708802f99db92a0d156705ec9ef801993b" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" @@ -3052,24 +2528,12 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - [[package]] name = "unicode-width" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" -[[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - [[package]] name = "untrusted" version = "0.7.1" @@ -3176,7 +2640,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -3198,7 +2662,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3219,25 +2683,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] - [[package]] name = "winapi" version = "0.2.8" @@ -3361,9 +2806,3 @@ name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "zeroize" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" diff --git a/Cargo.toml b/Cargo.toml index a69cb14..1bd11d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,6 @@ members = [ "aquatic_common", "aquatic_http", "aquatic_http_load_test", - "aquatic_http_private", "aquatic_http_protocol", "aquatic_toml_config", "aquatic_toml_config_derive", diff --git a/TODO.md b/TODO.md index d93fe5e..cfa7c32 100644 --- a/TODO.md +++ b/TODO.md @@ -7,11 +7,11 @@ * thiserror? * CI * uring load test? - -* ws: wait for crates release of glommio with membarrier fix (PR #558) -* Release new version * More non-CI integration tests? -* Remove aquatic_http_private? +* Non-trivial dependency updates + * toml v0.7 + * syn v2.0 + * simd-json v0.7 ## Medium priority diff --git a/aquatic_common/Cargo.toml b/aquatic_common/Cargo.toml index 9998c38..631c068 100644 --- a/aquatic_common/Cargo.toml +++ b/aquatic_common/Cargo.toml @@ -21,7 +21,7 @@ aquatic_toml_config.workspace = true ahash = "0.8" anyhow = "1" arc-swap = "1" -duplicate = "0.4" +duplicate = "1" git-testament = "0.2" hashbrown = "0.13" hex = "0.4" @@ -37,5 +37,5 @@ toml = "0.5" # Optional glommio = { version = "0.8", optional = true } hwloc = { version = "0.5", optional = true } -rustls = { version = "0.20", optional = true } +rustls = { version = "0.21", optional = true } rustls-pemfile = { version = "1", optional = true } diff --git a/aquatic_http/Cargo.toml b/aquatic_http/Cargo.toml index daa5abe..c7bb677 100644 --- a/aquatic_http/Cargo.toml +++ b/aquatic_http/Cargo.toml @@ -31,7 +31,7 @@ cfg-if = "1" either = "1" futures = "0.3" futures-lite = "1" -futures-rustls = "0.22" +futures-rustls = "0.24" glommio = "0.8" itoa = "1" libc = "0.2" @@ -47,7 +47,7 @@ rustls-pemfile = "1" serde = { version = "1", features = ["derive"] } signal-hook = { version = "0.3" } slab = "0.4" -socket2 = { version = "0.4", features = ["all"] } +socket2 = { version = "0.5", features = ["all"] } [dev-dependencies] quickcheck = "1" diff --git a/aquatic_http_load_test/Cargo.toml b/aquatic_http_load_test/Cargo.toml index eb16d30..dc6a141 100644 --- a/aquatic_http_load_test/Cargo.toml +++ b/aquatic_http_load_test/Cargo.toml @@ -20,14 +20,14 @@ aquatic_toml_config.workspace = true anyhow = "1" futures-lite = "1" -futures-rustls = "0.22" +futures-rustls = "0.24" hashbrown = "0.13" glommio = "0.8" log = "0.4" mimalloc = { version = "0.1", default-features = false } rand = { version = "0.8", features = ["small_rng"] } rand_distr = "0.4" -rustls = { version = "0.20", default-features = false, features = ["logging", "dangerous_configuration"] } # TLS 1.2 disabled +rustls = { version = "0.21", default-features = false, features = ["logging", "dangerous_configuration"] } # TLS 1.2 disabled serde = { version = "1", features = ["derive"] } [dev-dependencies] diff --git a/aquatic_http_private/Cargo.toml b/aquatic_http_private/Cargo.toml deleted file mode 100644 index 2bcde27..0000000 --- a/aquatic_http_private/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "aquatic_http_private" -keywords = ["http", "benchmark", "peer-to-peer", "torrent", "bittorrent"] -version.workspace = true -authors.workspace = true -edition.workspace = true -license.workspace = true -repository.workspace = true -readme.workspace = true -rust-version.workspace = true - -[lib] -name = "aquatic_http_private" - -[[bin]] -name = "aquatic_http_private" - -[dependencies] -aquatic_common = { workspace = true, features = ["rustls"] } -aquatic_http_protocol = { workspace = true, features = ["axum"] } -aquatic_toml_config.workspace = true - -anyhow = "1" -axum = { version = "0.5", default-features = false, features = ["headers", "http1", "matched-path", "original-uri"] } -dotenv = "0.15" -futures-util = { version = "0.3", default-features = false } -hex = "0.4" -hyper = "0.14" -log = "0.4" -mimalloc = { version = "0.1", default-features = false } -rand = { version = "0.8", features = ["small_rng"] } -rustls = "0.20" -serde = { version = "1", features = ["derive"] } -signal-hook = { version = "0.3" } -socket2 = { version = "0.4", features = ["all"] } -sqlx = { version = "0.6", features = [ "runtime-tokio-rustls" , "mysql" ] } -tokio = { version = "1", features = ["full"] } -tokio-rustls = "0.23" diff --git a/aquatic_http_private/README.md b/aquatic_http_private/README.md deleted file mode 100644 index 615d6b2..0000000 --- a/aquatic_http_private/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# aquatic_http_private - -HTTP (over TLS) BitTorrent tracker that calls a mysql stored procedure to -determine if requests can proceed. - -Work in progress. - -## Usage - -### Database setup - -* Create database (you will typically skip this step and use your own database): - -```sql -CREATE DATABASE aquatic_db; -``` - -* Create aquatic user (use a better password): - -```sql -CREATE USER 'aquatic'@localhost IDENTIFIED BY 'aquatic_password'; -``` - -* Create stored procedure `aquatic_announce_v1`: - -```sql --- Create stored procedure called by aquatic for each announce request. --- --- Set output parameter p_announce_allowed determines to true to allow announce. -CREATE OR REPLACE PROCEDURE aquatic_announce_v1 ( - -- Canonical source ip address (IPv4/IPv6) - IN p_source_ip VARBINARY(16), - -- Source port (not port where peer says it will accept BitTorrent requests) - IN p_source_port SMALLINT UNSIGNED, - -- User agent (can be NULL) - IN p_user_agent TEXT, - -- User token extracted from announce url ('/announce/USER_TOKEN/) - IN p_user_token VARCHAR(255), - -- Hex-encoded info hash - IN p_info_hash CHAR(40), - -- Peer ID. BINARY since it can be any bytes according to spec. - IN p_peer_id BINARY(20), - -- Event (started/stopped/completed) (can be NULL) - IN p_event VARCHAR(9), - -- Bytes uploaded. Passed directly from request. - IN p_uploaded BIGINT UNSIGNED, - -- Bytes downloaded. Passed directly from request. - IN p_downloaded BIGINT UNSIGNED, - -- Bytes left - IN p_left BIGINT UNSIGNED, - -- Return true to send annonunce response. Defaults to false if not set. - OUT p_announce_allowed BOOLEAN, - -- Optional failure reason. Defaults to NULL if not set. - OUT p_failure_reason TEXT, - -- Optional warning message. Defaults to NULL if not set. - OUT p_warning_message TEXT -) -MODIFIES SQL DATA -BEGIN - -- Replace with your custom code - SELECT true INTO p_announce_allowed; -END -``` - -* Give aquatic user permission to call stored procedure: - -```sql -GRANT EXECUTE ON PROCEDURE aquatic_db.aquatic_announce_v1 TO 'aquatic'@localhost; -FLUSH PRIVILEGES; -``` - -`CREATE OR REPLACE PROCEDURE` command, which leaves privileges in place, -requires MariaDB 10.1.3 or later. If your database does not support it, -each time you want to replace the procedure, you need to drop it, then -create it using `CREATE PROCEDURE` and grant execution privileges again. - -### Tracker setup - -* Install rust compiler and cmake - -* Create `.env` file with database credentials: - -```sh -DATABASE_URL="mysql://aquatic:aquatic_password@localhost/aquatic_db" -``` - -* Build and run tracker: - -```sh -# Build -cargo build --release -p aquatic_http_private -# Generate config file (remember to set paths to TLS cert and key) -./target/release/aquatic_http_private -p > http-private-config.toml -# Run tracker -./target/release/aquatic_http_private -c http-private-config.toml -``` diff --git a/aquatic_http_private/src/common.rs b/aquatic_http_private/src/common.rs deleted file mode 100644 index b1b247b..0000000 --- a/aquatic_http_private/src/common.rs +++ /dev/null @@ -1,52 +0,0 @@ -use tokio::sync::{mpsc, oneshot}; - -use aquatic_common::CanonicalSocketAddr; -use aquatic_http_protocol::{common::InfoHash, response::Response}; - -use crate::{config::Config, workers::socket::db::ValidatedAnnounceRequest}; - -#[derive(Debug)] -pub struct ChannelAnnounceRequest { - pub request: ValidatedAnnounceRequest, - pub source_addr: CanonicalSocketAddr, - pub response_sender: oneshot::Sender, -} - -#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] -pub struct RequestWorkerIndex(pub usize); - -impl RequestWorkerIndex { - pub fn from_info_hash(config: &Config, info_hash: InfoHash) -> Self { - Self(info_hash.0[0] as usize % config.swarm_workers) - } -} - -pub struct ChannelRequestSender(Vec>); - -impl ChannelRequestSender { - pub fn new(senders: Vec>) -> Self { - Self(senders) - } - - pub async fn send_to( - &self, - index: RequestWorkerIndex, - request: ValidatedAnnounceRequest, - source_addr: CanonicalSocketAddr, - ) -> anyhow::Result> { - let (response_sender, response_receiver) = oneshot::channel(); - - let request = ChannelAnnounceRequest { - request, - source_addr, - response_sender, - }; - - match self.0[index.0].send(request).await { - Ok(()) => Ok(response_receiver), - Err(err) => { - Err(anyhow::Error::new(err).context("error sending ChannelAnnounceRequest")) - } - } - } -} diff --git a/aquatic_http_private/src/config.rs b/aquatic_http_private/src/config.rs deleted file mode 100644 index d678956..0000000 --- a/aquatic_http_private/src/config.rs +++ /dev/null @@ -1,119 +0,0 @@ -use std::{net::SocketAddr, path::PathBuf}; - -use aquatic_common::privileges::PrivilegeConfig; -use aquatic_toml_config::TomlConfig; -use serde::Deserialize; - -use aquatic_common::cli::LogLevel; - -/// aquatic_http_private configuration -#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)] -#[serde(default, deny_unknown_fields)] -pub struct Config { - /// Socket workers receive requests from the socket, parse them and send - /// them on to the swarm workers. They then receive responses from the - /// swarm workers, encode them and send them back over the socket. - pub socket_workers: usize, - /// Swarm workers receive a number of requests from socket workers, - /// generate responses and send them back to the socket workers. - pub swarm_workers: usize, - pub worker_channel_size: usize, - /// Number of database connections to establish in each socket worker - pub db_connections_per_worker: u32, - pub log_level: LogLevel, - pub network: NetworkConfig, - pub protocol: ProtocolConfig, - pub cleaning: CleaningConfig, - pub privileges: PrivilegeConfig, -} - -impl Default for Config { - fn default() -> Self { - Self { - socket_workers: 1, - swarm_workers: 1, - worker_channel_size: 128, - db_connections_per_worker: 4, - log_level: LogLevel::default(), - network: NetworkConfig::default(), - protocol: ProtocolConfig::default(), - cleaning: CleaningConfig::default(), - privileges: PrivilegeConfig::default(), - } - } -} - -impl aquatic_common::cli::Config for Config { - fn get_log_level(&self) -> Option { - Some(self.log_level) - } -} - -#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)] -#[serde(default, deny_unknown_fields)] -pub struct NetworkConfig { - /// Bind to this address - pub address: SocketAddr, - /// Path to TLS certificate (DER-encoded X.509) - pub tls_certificate_path: PathBuf, - /// Path to TLS private key (DER-encoded ASN.1 in PKCS#8 or PKCS#1 format) - pub tls_private_key_path: PathBuf, - pub keep_alive: bool, -} - -impl Default for NetworkConfig { - fn default() -> Self { - Self { - address: SocketAddr::from(([0, 0, 0, 0], 3000)), - tls_certificate_path: "".into(), - tls_private_key_path: "".into(), - keep_alive: true, - } - } -} - -#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)] -#[serde(default, deny_unknown_fields)] -pub struct ProtocolConfig { - /// Maximum number of torrents to accept in scrape request - pub max_scrape_torrents: usize, - /// Maximum number of requested peers to accept in announce request - pub max_peers: usize, - /// Ask peers to announce this often (seconds) - pub peer_announce_interval: usize, -} - -impl Default for ProtocolConfig { - fn default() -> Self { - Self { - max_scrape_torrents: 100, - max_peers: 50, - peer_announce_interval: 300, - } - } -} - -#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)] -#[serde(default, deny_unknown_fields)] -pub struct CleaningConfig { - /// Clean peers this often (seconds) - pub torrent_cleaning_interval: u64, - /// Remove peers that have not announced for this long (seconds) - pub max_peer_age: u32, -} - -impl Default for CleaningConfig { - fn default() -> Self { - Self { - torrent_cleaning_interval: 30, - max_peer_age: 360, - } - } -} - -#[cfg(test)] -mod tests { - use super::Config; - - ::aquatic_toml_config::gen_serialize_deserialize_test!(Config); -} diff --git a/aquatic_http_private/src/lib.rs b/aquatic_http_private/src/lib.rs deleted file mode 100644 index 4193025..0000000 --- a/aquatic_http_private/src/lib.rs +++ /dev/null @@ -1,103 +0,0 @@ -mod common; -pub mod config; -mod workers; - -use std::{collections::VecDeque, sync::Arc}; - -use aquatic_common::{ - privileges::PrivilegeDropper, rustls_config::create_rustls_config, PanicSentinelWatcher, - ServerStartInstant, -}; -use common::ChannelRequestSender; -use dotenv::dotenv; -use signal_hook::{consts::SIGTERM, iterator::Signals}; -use tokio::sync::mpsc::channel; - -use config::Config; - -pub const APP_NAME: &str = "aquatic_http_private: private HTTP/TLS BitTorrent tracker"; -pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); - -pub fn run(config: Config) -> anyhow::Result<()> { - let mut signals = Signals::new([SIGTERM])?; - - dotenv().ok(); - - let tls_config = Arc::new(create_rustls_config( - &config.network.tls_certificate_path, - &config.network.tls_private_key_path, - )?); - - let mut request_senders = Vec::new(); - let mut request_receivers = VecDeque::new(); - - for _ in 0..config.swarm_workers { - let (request_sender, request_receiver) = channel(config.worker_channel_size); - - request_senders.push(request_sender); - request_receivers.push_back(request_receiver); - } - - let (sentinel_watcher, sentinel) = PanicSentinelWatcher::create_with_sentinel(); - let priv_dropper = PrivilegeDropper::new(config.privileges.clone(), config.socket_workers); - - let server_start_instant = ServerStartInstant::new(); - - let mut handles = Vec::new(); - - for _ in 0..config.socket_workers { - let sentinel = sentinel.clone(); - let config = config.clone(); - let tls_config = tls_config.clone(); - let request_sender = ChannelRequestSender::new(request_senders.clone()); - let priv_dropper = priv_dropper.clone(); - - let handle = ::std::thread::Builder::new() - .name("socket".into()) - .spawn(move || { - workers::socket::run_socket_worker( - sentinel, - config, - tls_config, - request_sender, - priv_dropper, - ) - })?; - - handles.push(handle); - } - - for _ in 0..config.swarm_workers { - let sentinel = sentinel.clone(); - let config = config.clone(); - let request_receiver = request_receivers.pop_front().unwrap(); - - let handle = ::std::thread::Builder::new() - .name("request".into()) - .spawn(move || { - workers::swarm::run_swarm_worker( - sentinel, - config, - request_receiver, - server_start_instant, - ) - })?; - - handles.push(handle); - } - - for signal in &mut signals { - match signal { - SIGTERM => { - if sentinel_watcher.panic_was_triggered() { - return Err(anyhow::anyhow!("worker thread panicked")); - } else { - return Ok(()); - } - } - _ => unreachable!(), - } - } - - Ok(()) -} diff --git a/aquatic_http_private/src/main.rs b/aquatic_http_private/src/main.rs deleted file mode 100644 index caf3cbc..0000000 --- a/aquatic_http_private/src/main.rs +++ /dev/null @@ -1,14 +0,0 @@ -use aquatic_common::cli::run_app_with_cli_and_config; -use aquatic_http_private::config::Config; - -#[global_allocator] -static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; - -fn main() { - run_app_with_cli_and_config::( - aquatic_http_private::APP_NAME, - aquatic_http_private::APP_VERSION, - aquatic_http_private::run, - None, - ) -} diff --git a/aquatic_http_private/src/workers/mod.rs b/aquatic_http_private/src/workers/mod.rs deleted file mode 100644 index 28ef095..0000000 --- a/aquatic_http_private/src/workers/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod socket; -pub mod swarm; diff --git a/aquatic_http_private/src/workers/socket/db.rs b/aquatic_http_private/src/workers/socket/db.rs deleted file mode 100644 index 89b7396..0000000 --- a/aquatic_http_private/src/workers/socket/db.rs +++ /dev/null @@ -1,119 +0,0 @@ -use std::net::IpAddr; - -use aquatic_common::CanonicalSocketAddr; -use aquatic_http_protocol::{request::AnnounceRequest, response::FailureResponse}; -use sqlx::{Executor, MySql, Pool}; - -#[derive(Debug)] -pub struct ValidatedAnnounceRequest(AnnounceRequest); - -impl Into for ValidatedAnnounceRequest { - fn into(self) -> AnnounceRequest { - self.0 - } -} - -#[derive(Debug, sqlx::FromRow)] -struct AnnounceProcedureResults { - announce_allowed: bool, - failure_reason: Option, - warning_message: Option, -} - -pub async fn validate_announce_request( - pool: &Pool, - source_addr: CanonicalSocketAddr, - user_agent: Option, - user_token: String, - request: AnnounceRequest, -) -> Result<(ValidatedAnnounceRequest, Option), FailureResponse> { - match call_announce_procedure(pool, source_addr, user_agent, user_token, &request).await { - Ok(results) => { - if results.announce_allowed { - Ok((ValidatedAnnounceRequest(request), results.warning_message)) - } else { - Err(FailureResponse::new( - results - .failure_reason - .unwrap_or_else(|| "Not allowed".into()), - )) - } - } - Err(err) => { - ::log::error!("announce procedure error: {:#}", err); - - Err(FailureResponse::new("Internal error")) - } - } -} - -async fn call_announce_procedure( - pool: &Pool, - source_addr: CanonicalSocketAddr, - user_agent: Option, - user_token: String, // FIXME: length - request: &AnnounceRequest, -) -> anyhow::Result { - let mut t = pool.begin().await?; - - t.execute( - " - SET - @p_announce_allowed = false, - @p_failure_reason = NULL, - @p_warning_message = NULL; - ", - ) - .await?; - - let q = sqlx::query( - " - CALL aquatic_announce_v1( - ?, - ?, - ?, - ?, - ?, - ?, - ?, - ?, - ?, - ?, - @p_announce_allowed, - @p_failure_reason, - @p_warning_message - ); - ", - ) - .bind(match source_addr.get().ip() { - IpAddr::V4(ip) => Vec::from(ip.octets()), - IpAddr::V6(ip) => Vec::from(ip.octets()), - }) - .bind(source_addr.get().port()) - .bind(user_agent) - .bind(user_token) - .bind(hex::encode(request.info_hash.0)) - .bind(&request.peer_id.0[..]) - .bind(request.event.as_str()) - .bind(request.bytes_uploaded as u64) - .bind(request.bytes_downloaded as u64) - .bind(request.bytes_left as u64); - - t.execute(q).await?; - - let response = sqlx::query_as::<_, AnnounceProcedureResults>( - " - SELECT - @p_announce_allowed as announce_allowed, - @p_failure_reason as failure_reason, - @p_warning_message as warning_message; - - ", - ) - .fetch_one(&mut t) - .await?; - - t.commit().await?; - - Ok(response) -} diff --git a/aquatic_http_private/src/workers/socket/mod.rs b/aquatic_http_private/src/workers/socket/mod.rs deleted file mode 100644 index 24e561b..0000000 --- a/aquatic_http_private/src/workers/socket/mod.rs +++ /dev/null @@ -1,104 +0,0 @@ -pub mod db; -mod routes; -mod tls; - -use std::{ - net::{SocketAddr, TcpListener}, - sync::Arc, -}; - -use anyhow::Context; -use aquatic_common::{privileges::PrivilegeDropper, rustls_config::RustlsConfig, PanicSentinel}; -use axum::{extract::connect_info::Connected, routing::get, Extension, Router}; -use hyper::server::conn::AddrIncoming; -use sqlx::mysql::MySqlPoolOptions; - -use self::tls::{TlsAcceptor, TlsStream}; -use crate::{common::ChannelRequestSender, config::Config}; - -impl<'a> Connected<&'a tls::TlsStream> for SocketAddr { - fn connect_info(target: &'a TlsStream) -> Self { - target.get_remote_addr() - } -} - -pub fn run_socket_worker( - _sentinel: PanicSentinel, - config: Config, - tls_config: Arc, - request_sender: ChannelRequestSender, - priv_dropper: PrivilegeDropper, -) -> anyhow::Result<()> { - let tcp_listener = create_tcp_listener(config.network.address, priv_dropper)?; - - let runtime = tokio::runtime::Builder::new_current_thread() - .enable_all() - .build()?; - - runtime.block_on(run_app(config, tls_config, tcp_listener, request_sender))?; - - Ok(()) -} - -async fn run_app( - config: Config, - tls_config: Arc, - tcp_listener: TcpListener, - request_sender: ChannelRequestSender, -) -> anyhow::Result<()> { - let db_url = - ::std::env::var("DATABASE_URL").with_context(|| "Retrieve env var DATABASE_URL")?; - - let tls_acceptor = TlsAcceptor::new( - tls_config, - AddrIncoming::from_listener(tokio::net::TcpListener::from_std(tcp_listener)?)?, - ); - - let pool = MySqlPoolOptions::new() - .max_connections(config.db_connections_per_worker) - .connect(&db_url) - .await?; - - let app = Router::new() - .route("/announce/:user_token/", get(routes::announce)) - .layer(Extension(Arc::new(config.clone()))) - .layer(Extension(pool)) - .layer(Extension(Arc::new(request_sender))); - - axum::Server::builder(tls_acceptor) - .http1_keepalive(config.network.keep_alive) - .serve(app.into_make_service_with_connect_info::()) - .await?; - - Ok(()) -} - -fn create_tcp_listener( - addr: SocketAddr, - priv_dropper: PrivilegeDropper, -) -> anyhow::Result { - let domain = if addr.is_ipv4() { - socket2::Domain::IPV4 - } else { - socket2::Domain::IPV6 - }; - - let socket = socket2::Socket::new(domain, socket2::Type::STREAM, Some(socket2::Protocol::TCP))?; - - socket - .set_reuse_port(true) - .with_context(|| "set_reuse_port")?; - socket - .set_nonblocking(true) - .with_context(|| "set_nonblocking")?; - socket - .bind(&addr.into()) - .with_context(|| format!("bind to {}", addr))?; - socket - .listen(1024) - .with_context(|| format!("listen on {}", addr))?; - - priv_dropper.after_socket_creation()?; - - Ok(socket.into()) -} diff --git a/aquatic_http_private/src/workers/socket/routes.rs b/aquatic_http_private/src/workers/socket/routes.rs deleted file mode 100644 index 1d83f29..0000000 --- a/aquatic_http_private/src/workers/socket/routes.rs +++ /dev/null @@ -1,65 +0,0 @@ -use aquatic_common::CanonicalSocketAddr; -use axum::{ - extract::{ConnectInfo, Path, RawQuery}, - headers::UserAgent, - Extension, TypedHeader, -}; -use sqlx::mysql::MySqlPool; -use std::{net::SocketAddr, sync::Arc}; - -use aquatic_http_protocol::{ - request::AnnounceRequest, - response::{FailureResponse, Response}, -}; - -use crate::{ - common::{ChannelRequestSender, RequestWorkerIndex}, - config::Config, -}; - -use super::db; - -pub async fn announce( - Extension(config): Extension>, - Extension(pool): Extension, - Extension(request_sender): Extension>, - ConnectInfo(source_addr): ConnectInfo, - opt_user_agent: Option>, - Path(user_token): Path, - RawQuery(query): RawQuery, -) -> Result { - let query = query.ok_or_else(|| FailureResponse::new("Empty query string"))?; - - let request = AnnounceRequest::from_query_string(&query) - .map_err(|_| FailureResponse::new("Malformed request"))?; - - let swarm_worker_index = RequestWorkerIndex::from_info_hash(&config, request.info_hash); - let opt_user_agent = opt_user_agent.map(|header| header.as_str().to_owned()); - - let source_addr = CanonicalSocketAddr::new(source_addr); - - let (validated_request, opt_warning_message) = - db::validate_announce_request(&pool, source_addr, opt_user_agent, user_token, request) - .await?; - - let response_receiver = request_sender - .send_to(swarm_worker_index, validated_request, source_addr) - .await - .map_err(|err| internal_error(format!("Sending request over channel failed: {:#}", err)))?; - - let mut response = response_receiver.await.map_err(|err| { - internal_error(format!("Receiving response over channel failed: {:#}", err)) - })?; - - if let Response::Announce(ref mut r) = response { - r.warning_message = opt_warning_message; - } - - Ok(response) -} - -fn internal_error(error: String) -> FailureResponse { - ::log::error!("{}", error); - - FailureResponse::new("Internal error") -} diff --git a/aquatic_http_private/src/workers/socket/tls.rs b/aquatic_http_private/src/workers/socket/tls.rs deleted file mode 100644 index 3828b29..0000000 --- a/aquatic_http_private/src/workers/socket/tls.rs +++ /dev/null @@ -1,151 +0,0 @@ -//! hyper/rustls integration -//! -//! hyper will automatically use HTTP/2 if a client starts talking HTTP/2, -//! otherwise HTTP/1.1 will be used. -//! -//! Based on https://github.com/rustls/hyper-rustls/blob/9b7b1220f74de9b249ce2b8f8b922fd00074c53b/examples/server.rs - -// ISC License (ISC) -// Copyright (c) 2016, Joseph Birr-Pixton -// -// Permission to use, copy, modify, and/or distribute this software for -// any purpose with or without fee is hereby granted, provided that the -// above copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL -// WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -// AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -// DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -// PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -// ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -// THIS SOFTWARE. - -use core::task::{Context, Poll}; -use futures_util::ready; -use hyper::server::accept::Accept; -use hyper::server::conn::{AddrIncoming, AddrStream}; -use std::future::Future; -use std::io; -use std::net::SocketAddr; -use std::pin::Pin; -use std::sync::Arc; -use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; -use tokio_rustls::rustls::ServerConfig; - -enum State { - Handshaking(tokio_rustls::Accept, SocketAddr), - Streaming(tokio_rustls::server::TlsStream), -} - -// tokio_rustls::server::TlsStream doesn't expose constructor methods, -// so we have to TlsAcceptor::accept and handshake to have access to it -// TlsStream implements AsyncRead/AsyncWrite handshaking tokio_rustls::Accept first -pub struct TlsStream { - state: State, -} - -impl TlsStream { - fn new(stream: AddrStream, config: Arc) -> TlsStream { - let remote_addr = stream.remote_addr(); - let accept = tokio_rustls::TlsAcceptor::from(config).accept(stream); - - TlsStream { - state: State::Handshaking(accept, remote_addr), - } - } - - pub fn get_remote_addr(&self) -> SocketAddr { - match &self.state { - State::Handshaking(_, remote_addr) => *remote_addr, - State::Streaming(stream) => stream.get_ref().0.remote_addr(), - } - } -} - -impl AsyncRead for TlsStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &mut ReadBuf, - ) -> Poll> { - let pin = self.get_mut(); - match pin.state { - State::Handshaking(ref mut accept, ref mut socket_addr) => { - match ready!(Pin::new(accept).poll(cx)) { - Ok(mut stream) => { - *socket_addr = stream.get_ref().0.remote_addr(); - let result = Pin::new(&mut stream).poll_read(cx, buf); - pin.state = State::Streaming(stream); - result - } - Err(err) => Poll::Ready(Err(err)), - } - } - State::Streaming(ref mut stream) => Pin::new(stream).poll_read(cx, buf), - } - } -} - -impl AsyncWrite for TlsStream { - fn poll_write( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - buf: &[u8], - ) -> Poll> { - let pin = self.get_mut(); - match pin.state { - State::Handshaking(ref mut accept, _) => match ready!(Pin::new(accept).poll(cx)) { - Ok(mut stream) => { - let result = Pin::new(&mut stream).poll_write(cx, buf); - pin.state = State::Streaming(stream); - result - } - Err(err) => Poll::Ready(Err(err)), - }, - State::Streaming(ref mut stream) => Pin::new(stream).poll_write(cx, buf), - } - } - - fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - match self.state { - State::Handshaking(_, _) => Poll::Ready(Ok(())), - State::Streaming(ref mut stream) => Pin::new(stream).poll_flush(cx), - } - } - - fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - match self.state { - State::Handshaking(_, _) => Poll::Ready(Ok(())), - State::Streaming(ref mut stream) => Pin::new(stream).poll_shutdown(cx), - } - } -} - -pub struct TlsAcceptor { - config: Arc, - incoming: AddrIncoming, -} - -impl TlsAcceptor { - pub fn new(config: Arc, incoming: AddrIncoming) -> TlsAcceptor { - TlsAcceptor { config, incoming } - } -} - -impl Accept for TlsAcceptor { - type Conn = TlsStream; - type Error = io::Error; - - fn poll_accept( - self: Pin<&mut Self>, - cx: &mut Context<'_>, - ) -> Poll>> { - let pin = self.get_mut(); - match ready!(Pin::new(&mut pin.incoming).poll_accept(cx)) { - Some(Ok(sock)) => Poll::Ready(Some(Ok(TlsStream::new(sock, pin.config.clone())))), - Some(Err(e)) => Poll::Ready(Some(Err(e))), - None => Poll::Ready(None), - } - } -} diff --git a/aquatic_http_private/src/workers/swarm/common.rs b/aquatic_http_private/src/workers/swarm/common.rs deleted file mode 100644 index 22ad497..0000000 --- a/aquatic_http_private/src/workers/swarm/common.rs +++ /dev/null @@ -1,121 +0,0 @@ -use std::net::{Ipv4Addr, Ipv6Addr}; - -use aquatic_common::{IndexMap, SecondsSinceServerStart, ServerStartInstant, ValidUntil}; -use aquatic_http_protocol::common::{AnnounceEvent, InfoHash, PeerId}; -use aquatic_http_protocol::response::ResponsePeer; - -pub trait Ip: ::std::fmt::Debug + Copy + Eq + ::std::hash::Hash {} - -impl Ip for Ipv4Addr {} -impl Ip for Ipv6Addr {} - -#[derive(PartialEq, Eq, Clone, Copy, Debug)] -pub enum PeerStatus { - Seeding, - Leeching, - Stopped, -} - -impl PeerStatus { - /// Determine peer status from announce event and number of bytes left. - /// - /// Likely, the last branch will be taken most of the time. - #[inline] - pub fn from_event_and_bytes_left(event: AnnounceEvent, opt_bytes_left: Option) -> Self { - if let AnnounceEvent::Stopped = event { - Self::Stopped - } else if let Some(0) = opt_bytes_left { - Self::Seeding - } else { - Self::Leeching - } - } -} - -#[derive(Debug, Clone, Copy)] -pub struct Peer { - pub ip_address: I, - pub port: u16, - pub status: PeerStatus, - pub valid_until: ValidUntil, -} - -impl Peer { - pub fn to_response_peer(&self) -> ResponsePeer { - ResponsePeer { - ip_address: self.ip_address, - port: self.port, - } - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct PeerMapKey { - pub peer_id: PeerId, - pub ip_address: I, -} - -pub type PeerMap = IndexMap, Peer>; - -pub struct TorrentData { - pub peers: PeerMap, - pub num_seeders: usize, - pub num_leechers: usize, -} - -impl Default for TorrentData { - #[inline] - fn default() -> Self { - Self { - peers: Default::default(), - num_seeders: 0, - num_leechers: 0, - } - } -} - -pub type TorrentMap = IndexMap>; - -#[derive(Default)] -pub struct TorrentMaps { - pub ipv4: TorrentMap, - pub ipv6: TorrentMap, -} - -impl TorrentMaps { - pub fn clean(&mut self, server_start_instant: ServerStartInstant) { - let now = server_start_instant.seconds_elapsed(); - - Self::clean_torrent_map(&mut self.ipv4, now); - Self::clean_torrent_map(&mut self.ipv6, now); - } - - fn clean_torrent_map(torrent_map: &mut TorrentMap, now: SecondsSinceServerStart) { - torrent_map.retain(|_, torrent_data| { - let num_seeders = &mut torrent_data.num_seeders; - let num_leechers = &mut torrent_data.num_leechers; - - torrent_data.peers.retain(|_, peer| { - if peer.valid_until.valid(now) { - true - } else { - match peer.status { - PeerStatus::Seeding => { - *num_seeders -= 1; - } - PeerStatus::Leeching => { - *num_leechers -= 1; - } - _ => (), - }; - - false - } - }); - - !torrent_data.peers.is_empty() - }); - - torrent_map.shrink_to_fit(); - } -} diff --git a/aquatic_http_private/src/workers/swarm/mod.rs b/aquatic_http_private/src/workers/swarm/mod.rs deleted file mode 100644 index 45fb5fb..0000000 --- a/aquatic_http_private/src/workers/swarm/mod.rs +++ /dev/null @@ -1,220 +0,0 @@ -mod common; - -use std::cell::RefCell; -use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; -use std::rc::Rc; - -use aquatic_http_protocol::request::AnnounceRequest; -use rand::prelude::SmallRng; -use rand::SeedableRng; -use tokio::sync::mpsc::Receiver; -use tokio::task::LocalSet; -use tokio::time; - -use aquatic_common::{ - extract_response_peers, CanonicalSocketAddr, PanicSentinel, ServerStartInstant, ValidUntil, -}; -use aquatic_http_protocol::response::{ - AnnounceResponse, Response, ResponsePeer, ResponsePeerListV4, ResponsePeerListV6, -}; - -use crate::common::ChannelAnnounceRequest; -use crate::config::Config; - -use common::*; - -pub fn run_swarm_worker( - _sentinel: PanicSentinel, - config: Config, - request_receiver: Receiver, - server_start_instant: ServerStartInstant, -) -> anyhow::Result<()> { - let runtime = tokio::runtime::Builder::new_current_thread() - .enable_all() - .build()?; - - runtime.block_on(run_inner(config, request_receiver, server_start_instant))?; - - Ok(()) -} - -async fn run_inner( - config: Config, - mut request_receiver: Receiver, - server_start_instant: ServerStartInstant, -) -> anyhow::Result<()> { - let torrents = Rc::new(RefCell::new(TorrentMaps::default())); - let mut rng = SmallRng::from_entropy(); - - LocalSet::new().spawn_local(periodically_clean_torrents( - config.clone(), - torrents.clone(), - server_start_instant, - )); - - loop { - let request = request_receiver - .recv() - .await - .ok_or_else(|| anyhow::anyhow!("request channel closed"))?; - - let valid_until = ValidUntil::new(server_start_instant, config.cleaning.max_peer_age); - - let response = handle_announce_request( - &config, - &mut rng, - &mut torrents.borrow_mut(), - valid_until, - request.source_addr, - request.request.into(), - ); - - let _ = request.response_sender.send(Response::Announce(response)); - } -} - -async fn periodically_clean_torrents( - config: Config, - torrents: Rc>, - server_start_instant: ServerStartInstant, -) { - let mut interval = time::interval(time::Duration::from_secs( - config.cleaning.torrent_cleaning_interval, - )); - - loop { - interval.tick().await; - - torrents.borrow_mut().clean(server_start_instant); - } -} - -fn handle_announce_request( - config: &Config, - rng: &mut SmallRng, - torrent_maps: &mut TorrentMaps, - valid_until: ValidUntil, - source_addr: CanonicalSocketAddr, - request: AnnounceRequest, -) -> AnnounceResponse { - match source_addr.get().ip() { - IpAddr::V4(source_ip) => { - let torrent_data: &mut TorrentData = - torrent_maps.ipv4.entry(request.info_hash).or_default(); - - let (seeders, leechers, response_peers) = upsert_peer_and_get_response_peers( - config, - rng, - torrent_data, - source_ip, - request, - valid_until, - ); - - let response = AnnounceResponse { - complete: seeders, - incomplete: leechers, - announce_interval: config.protocol.peer_announce_interval, - peers: ResponsePeerListV4(response_peers), - peers6: ResponsePeerListV6(vec![]), - warning_message: None, - }; - - response - } - IpAddr::V6(source_ip) => { - let torrent_data: &mut TorrentData = - torrent_maps.ipv6.entry(request.info_hash).or_default(); - - let (seeders, leechers, response_peers) = upsert_peer_and_get_response_peers( - config, - rng, - torrent_data, - source_ip, - request, - valid_until, - ); - - let response = AnnounceResponse { - complete: seeders, - incomplete: leechers, - announce_interval: config.protocol.peer_announce_interval, - peers: ResponsePeerListV4(vec![]), - peers6: ResponsePeerListV6(response_peers), - warning_message: None, - }; - - response - } - } -} - -/// Insert/update peer. Return num_seeders, num_leechers and response peers -pub fn upsert_peer_and_get_response_peers( - config: &Config, - rng: &mut SmallRng, - torrent_data: &mut TorrentData, - source_ip: I, - request: AnnounceRequest, - valid_until: ValidUntil, -) -> (usize, usize, Vec>) { - // Insert/update/remove peer who sent this request - - let peer_status = - PeerStatus::from_event_and_bytes_left(request.event, Some(request.bytes_left)); - - let peer = Peer { - ip_address: source_ip, - port: request.port, - status: peer_status, - valid_until, - }; - - let peer_map_key = PeerMapKey { - peer_id: request.peer_id, - ip_address: source_ip, - }; - - let opt_removed_peer = match peer_status { - PeerStatus::Leeching => { - torrent_data.num_leechers += 1; - - torrent_data.peers.insert(peer_map_key.clone(), peer) - } - PeerStatus::Seeding => { - torrent_data.num_seeders += 1; - - torrent_data.peers.insert(peer_map_key.clone(), peer) - } - PeerStatus::Stopped => torrent_data.peers.remove(&peer_map_key), - }; - - match opt_removed_peer.map(|peer| peer.status) { - Some(PeerStatus::Leeching) => { - torrent_data.num_leechers -= 1; - } - Some(PeerStatus::Seeding) => { - torrent_data.num_seeders -= 1; - } - _ => {} - } - - let max_num_peers_to_take = match request.numwant { - Some(0) | None => config.protocol.max_peers, - Some(numwant) => numwant.min(config.protocol.max_peers), - }; - - let response_peers: Vec> = extract_response_peers( - rng, - &torrent_data.peers, - max_num_peers_to_take, - peer_map_key, - Peer::to_response_peer, - ); - - ( - torrent_data.num_seeders, - torrent_data.num_leechers, - response_peers, - ) -} diff --git a/aquatic_http_protocol/Cargo.toml b/aquatic_http_protocol/Cargo.toml index 606fb32..be0273f 100644 --- a/aquatic_http_protocol/Cargo.toml +++ b/aquatic_http_protocol/Cargo.toml @@ -25,7 +25,6 @@ harness = false [dependencies] anyhow = "1" -axum = { version = "0.5", optional = true, default-features = false } compact_str = { version = "0.7", features = ["serde"] } hex = { version = "0.4", default-features = false } httparse = "1" @@ -38,6 +37,6 @@ urlencoding = "2" [dev-dependencies] bendy = { version = "0.4.0-beta.2", features = ["std", "serde"] } -criterion = "0.3" +criterion = "0.4" quickcheck = "1" quickcheck_macros = "1" diff --git a/aquatic_http_protocol/src/response.rs b/aquatic_http_protocol/src/response.rs index 45f1139..cc1ee92 100644 --- a/aquatic_http_protocol/src/response.rs +++ b/aquatic_http_protocol/src/response.rs @@ -117,17 +117,6 @@ impl AnnounceResponse { } } -#[cfg(feature = "axum")] -impl axum::response::IntoResponse for AnnounceResponse { - fn into_response(self) -> axum::response::Response { - let mut response_bytes = Vec::with_capacity(128); - - self.write(&mut response_bytes).unwrap(); - - ([("Content-type", "text/plain")], response_bytes).into_response() - } -} - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ScrapeResponse { /// BTreeMap instead of HashMap since keys need to be serialized in order @@ -158,17 +147,6 @@ impl ScrapeResponse { } } -#[cfg(feature = "axum")] -impl axum::response::IntoResponse for ScrapeResponse { - fn into_response(self) -> axum::response::Response { - let mut response_bytes = Vec::with_capacity(128); - - self.write(&mut response_bytes).unwrap(); - - ([("Content-type", "text/plain")], response_bytes).into_response() - } -} - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct FailureResponse { #[serde(rename = "failure reason")] @@ -197,17 +175,6 @@ impl FailureResponse { } } -#[cfg(feature = "axum")] -impl axum::response::IntoResponse for FailureResponse { - fn into_response(self) -> axum::response::Response { - let mut response_bytes = Vec::with_capacity(64); - - self.write(&mut response_bytes).unwrap(); - - ([("Content-type", "text/plain")], response_bytes).into_response() - } -} - #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum Response { @@ -229,17 +196,6 @@ impl Response { } } -#[cfg(feature = "axum")] -impl axum::response::IntoResponse for Response { - fn into_response(self) -> axum::response::Response { - match self { - Self::Announce(r) => r.into_response(), - Self::Scrape(r) => r.into_response(), - Self::Failure(r) => r.into_response(), - } - } -} - #[cfg(test)] impl quickcheck::Arbitrary for ResponsePeer { fn arbitrary(g: &mut quickcheck::Gen) -> Self { diff --git a/aquatic_udp/Cargo.toml b/aquatic_udp/Cargo.toml index 099caa4..4919209 100644 --- a/aquatic_udp/Cargo.toml +++ b/aquatic_udp/Cargo.toml @@ -36,7 +36,7 @@ getrandom = "0.2" hashbrown = { version = "0.13", default-features = false } hdrhistogram = "7" hex = "0.4" -io-uring = { version = "0.5", optional = true } +io-uring = { version = "0.6", optional = true } libc = "0.2" log = "0.4" metrics = { version = "0.20", optional = true } @@ -48,7 +48,7 @@ rand = { version = "0.8", features = ["small_rng"] } serde = { version = "1", features = ["derive"] } signal-hook = { version = "0.3" } slab = "0.4" -socket2 = { version = "0.4", features = ["all"] } +socket2 = { version = "0.5", features = ["all"] } time = { version = "0.3", features = ["formatting"] } tinytemplate = "1" diff --git a/aquatic_udp/src/workers/socket/uring/buf_ring.rs b/aquatic_udp/src/workers/socket/uring/buf_ring.rs index 7862753..1365b84 100644 --- a/aquatic_udp/src/workers/socket/uring/buf_ring.rs +++ b/aquatic_udp/src/workers/socket/uring/buf_ring.rs @@ -743,7 +743,7 @@ impl RawBufRing { // Future: move to separate public function so other buf_ring implementations // can register, and unregister, the same way. - let res = CurrentRing::with(|ring| { + let res = CurrentRing::with(|ring| unsafe { ring.submitter() .register_buf_ring(self.ring_addr as _, self.ring_entries(), bgid) }); diff --git a/aquatic_udp_load_test/Cargo.toml b/aquatic_udp_load_test/Cargo.toml index 5869536..6802cfc 100644 --- a/aquatic_udp_load_test/Cargo.toml +++ b/aquatic_udp_load_test/Cargo.toml @@ -28,7 +28,7 @@ mio = { version = "0.8", features = ["net", "os-poll"] } rand_distr = "0.4" rand = { version = "0.8", features = ["small_rng"] } serde = { version = "1", features = ["derive"] } -socket2 = { version = "0.4", features = ["all"] } +socket2 = { version = "0.5", features = ["all"] } [dev-dependencies] quickcheck = "1" diff --git a/aquatic_ws/Cargo.toml b/aquatic_ws/Cargo.toml index b13d1f4..8d1bddc 100644 --- a/aquatic_ws/Cargo.toml +++ b/aquatic_ws/Cargo.toml @@ -27,11 +27,11 @@ aquatic_toml_config.workspace = true aquatic_ws_protocol.workspace = true anyhow = "1" -async-tungstenite = "0.19" +async-tungstenite = "0.20" cfg-if = "1" futures = "0.3" futures-lite = "1" -futures-rustls = "0.22" +futures-rustls = "0.24" glommio = "0.8" hashbrown = { version = "0.13", features = ["serde"] } httparse = "1" @@ -41,12 +41,12 @@ metrics-exporter-prometheus = { version = "0.11", optional = true, default-featu mimalloc = { version = "0.1", default-features = false } privdrop = "0.5" rand = { version = "0.8", features = ["small_rng"] } -rustls = "0.20" +rustls = "0.21" rustls-pemfile = "1" serde = { version = "1", features = ["derive"] } signal-hook = { version = "0.3" } slab = "0.4" -socket2 = { version = "0.4", features = ["all"] } +socket2 = { version = "0.5", features = ["all"] } tungstenite = "0.18" [dev-dependencies] diff --git a/aquatic_ws_load_test/Cargo.toml b/aquatic_ws_load_test/Cargo.toml index 8da34cd..d6dae34 100644 --- a/aquatic_ws_load_test/Cargo.toml +++ b/aquatic_ws_load_test/Cargo.toml @@ -19,15 +19,15 @@ aquatic_toml_config.workspace = true aquatic_ws_protocol.workspace = true anyhow = "1" -async-tungstenite = "0.19" +async-tungstenite = "0.20" futures = "0.3" -futures-rustls = "0.22" +futures-rustls = "0.24" glommio = "0.8" log = "0.4" mimalloc = { version = "0.1", default-features = false } rand = { version = "0.8", features = ["small_rng"] } rand_distr = "0.4" -rustls = { version = "0.20", default-features = false, features = ["dangerous_configuration"] } +rustls = { version = "0.21", default-features = false, features = ["dangerous_configuration"] } serde = { version = "1", features = ["derive"] } serde_json = "1" tungstenite = "0.18" diff --git a/aquatic_ws_protocol/Cargo.toml b/aquatic_ws_protocol/Cargo.toml index b04f19a..faeec1e 100644 --- a/aquatic_ws_protocol/Cargo.toml +++ b/aquatic_ws_protocol/Cargo.toml @@ -30,6 +30,6 @@ simd-json = { version = "0.6", features = ["allow-non-simd"] } tungstenite = "0.18" [dev-dependencies] -criterion = "0.3" +criterion = "0.4" quickcheck = "1" quickcheck_macros = "1" diff --git a/scripts/run-aquatic-http-private.sh b/scripts/run-aquatic-http-private.sh deleted file mode 100755 index 9809ee8..0000000 --- a/scripts/run-aquatic-http-private.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -. ./scripts/env-native-cpu-without-avx-512 - -cargo run --profile "release-debug" -p aquatic_http_private -- $@