From 9a1bc1c25d56e47288e7a1055151c408c92931b4 Mon Sep 17 00:00:00 2001 From: Crossedfall Date: Fri, 23 Oct 2020 20:38:09 -0500 Subject: [PATCH] Upstream merge (#5) Co-authored-by: aspen Co-authored-by: ZeWaka Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com> Co-authored-by: Tad Hardesty Co-authored-by: Pieter-Jan Briers --- Cargo.lock | 1456 +++++++++++++++++++++++--------------------------- Cargo.toml | 46 +- README.md | 19 +- build.rs | 12 + src/dmi.rs | 9 +- src/error.rs | 95 +--- src/file.rs | 34 +- src/hash.rs | 58 +- src/http.rs | 30 +- src/jobs.rs | 10 +- src/json.rs | 75 +++ src/lib.rs | 32 +- src/sql.rs | 84 +-- src/url.rs | 4 +- 14 files changed, 954 insertions(+), 1010 deletions(-) create mode 100644 src/json.rs diff --git a/Cargo.lock b/Cargo.lock index 6c1db98f..38bb2eec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,34 +1,31 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "addr2line" -version = "0.12.1" +name = "adler" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49806b9dadc843c61e7c97e72490ad7f7220ae249012fbda9ad0609457c0543" -dependencies = [ - "gimli", -] +checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" [[package]] name = "adler32" -version = "1.0.4" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "ahash" -version = "0.2.18" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" +checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" dependencies = [ "const-random", ] [[package]] name = "aho-corasick" -version = "0.7.10" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" +checksum = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d" dependencies = [ "memchr", ] @@ -41,28 +38,9 @@ checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" [[package]] name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - -[[package]] -name = "autocfg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" - -[[package]] -name = "backtrace" -version = "0.3.48" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0df2f85c8a2abbe3b7d7e748052fdd9b76a0458fdeb16ad4223f5eca78c7c130" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "object", - "rustc-demangle", -] +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "base-x" @@ -72,18 +50,9 @@ checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" [[package]] name = "base64" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -dependencies = [ - "byteorder", -] - -[[package]] -name = "base64" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d1ccbaf7d9ec9537465a97bf19edc1a4e158ecb49fc16178202238c569cc42" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" [[package]] name = "bigdecimal" @@ -93,7 +62,7 @@ checksum = "1374191e2dd25f9ae02e3aa95041ed5d747fc77b3c102b49fe2dd9a8117a6244" dependencies = [ "num-bigint", "num-integer", - "num-traits 0.2.11", + "num-traits 0.2.12", "serde", ] @@ -112,7 +81,16 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.4", ] [[package]] @@ -132,9 +110,9 @@ checksum = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8" [[package]] name = "bumpalo" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5356f1d23ee24a1f785a56d1d1a5f0fd5b0f6a0c0fb2412ce11da71649ab78f6" +checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" [[package]] name = "byte-tools" @@ -150,26 +128,18 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "either", - "iovec", -] - -[[package]] -name = "bytes" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" +checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "cc" -version = "1.0.54" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" +checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" +dependencies = [ + "jobserver", +] [[package]] name = "cfg-if" @@ -179,14 +149,16 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "chrono" -version = "0.4.11" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ + "libc", "num-integer", - "num-traits 0.2.11", + "num-traits 0.2.12", "serde", - "time 0.1.43", + "time 0.1.44", + "winapi 0.3.9", ] [[package]] @@ -200,33 +172,15 @@ dependencies = [ [[package]] name = "color_quant" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd" - -[[package]] -name = "commoncrypto" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d056a8586ba25a1e4d61cb090900e495952c7886786fc55f909ab2f819b69007" -dependencies = [ - "commoncrypto-sys", -] - -[[package]] -name = "commoncrypto-sys" -version = "0.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fed34f46747aa73dfaa578069fd8279d2818ade2b55f38f22a9401c7f4083e2" -dependencies = [ - "libc", -] +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "const-random" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" +checksum = "02dc82c12dc2ee6e1ded861cf7d582b46f66f796d1b6c93fa28b911ead95da02" dependencies = [ "const-random-macro", "proc-macro-hack", @@ -234,41 +188,19 @@ dependencies = [ [[package]] name = "const-random-macro" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" +checksum = "fc757bbb9544aa296c2ae00c679e81f886b37e28e59097defe0cf524306f6685" dependencies = [ - "getrandom", + "getrandom 0.2.0", "proc-macro-hack", ] [[package]] -name = "cookie" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" -dependencies = [ - "time 0.1.43", - "url 1.7.2", -] - -[[package]] -name = "cookie_store" -version = "0.7.0" +name = "const_fn" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" -dependencies = [ - "cookie", - "failure", - "idna 0.1.5", - "log", - "publicsuffix", - "serde", - "serde_json", - "time 0.1.43", - "try_from", - "url 1.7.2", -] +checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" [[package]] name = "core-foundation" @@ -286,6 +218,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +[[package]] +name = "cpuid-bool" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" + [[package]] name = "crc32fast" version = "1.2.0" @@ -295,6 +233,16 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils", + "maybe-uninit", +] + [[package]] name = "crossbeam-deque" version = "0.7.3" @@ -312,7 +260,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 1.0.0", + "autocfg", "cfg-if", "crossbeam-utils", "lazy_static", @@ -321,53 +269,43 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "crossbeam-queue" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.0", + "autocfg", "cfg-if", "lazy_static", ] [[package]] -name = "crypto-hash" -version = "0.3.4" +name = "dashmap" +version = "3.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a77162240fd97248d19a564a565eb563a3f592b386e4136fb300909e67dddca" +checksum = "0f260e2fc850179ef410018660006951c1b55b79e8087e87111a2c388994b9b5" dependencies = [ - "commoncrypto", - "hex", - "openssl", - "winapi 0.3.8", + "ahash", + "cfg-if", + "num_cpus", ] [[package]] -name = "ct-logs" -version = "0.6.0" +name = "deflate" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" +checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" dependencies = [ - "sct", + "adler32", + "byteorder", ] [[package]] name = "deflate" -version = "0.7.20" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" +checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" dependencies = [ "adler32", "byteorder", @@ -375,9 +313,9 @@ dependencies = [ [[package]] name = "derive_utils" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "114aa287358087a616096186f3de19525d8083f83d437dc6b583f895316b02e6" +checksum = "3df5480412da86cdf5d6b7f3b682422c84359ff7399aa658df1d15ee83244b1d" dependencies = [ "proc-macro2", "quote", @@ -390,7 +328,16 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.4", ] [[package]] @@ -401,21 +348,21 @@ checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "dtoa" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" +checksum = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" [[package]] name = "either" -version = "1.5.3" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ac63f94732332f44fe654443c46f6375d1939684c17b0afb6cb56b0456e171" +checksum = "a51b8cf747471cb9499b6d59e59b0444f4c90eba8968c4e44874e92b5b64ace2" dependencies = [ "cfg-if", ] @@ -429,37 +376,6 @@ dependencies = [ "num-traits 0.1.43", ] -[[package]] -name = "error-chain" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd" -dependencies = [ - "version_check", -] - -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "fake-simd" version = "0.1.2" @@ -468,15 +384,27 @@ checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" [[package]] name = "flate2" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" +checksum = "da80be589a72651dcda34d8b35bcdc9b7254ad06325611074d9cc0fbb19f60ee" dependencies = [ "cfg-if", "crc32fast", "libc", "libz-sys", - "miniz_oxide", + "miniz_oxide 0.4.3", +] + +[[package]] +name = "flume" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9e818efa7776f4dd7df0e542f877f7a5a87bddd6a1a10f59a7732b71ffb9d55" +dependencies = [ + "futures-core", + "futures-sink", + "rand 0.7.3", + "spinning_top", ] [[package]] @@ -523,19 +451,69 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] -name = "futures" -version = "0.1.29" +name = "futures-channel" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +checksum = "a7a4d35f7401e948629c9c3d6638fb9bf94e0b2121e96c3b428cc4e631f3eb74" +dependencies = [ + "futures-core", +] [[package]] -name = "futures-cpupool" -version = "0.1.8" +name = "futures-core" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d674eaa0056896d5ada519900dbf97ead2e46a7b6621e8160d79e2f2e1e2784b" + +[[package]] +name = "futures-io" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +checksum = "5fc94b64bb39543b4e432f1790b6bf18e3ee3b74653c5449f63310e9a74b123c" + +[[package]] +name = "futures-macro" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f57ed14da4603b2554682e9f2ff3c65d7567b53188db96cb71538217fc64581b" dependencies = [ - "futures", - "num_cpus", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8764258ed64ebc5d9ed185cf86a95db5cac810269c5d20ececb32e0088abbd" + +[[package]] +name = "futures-task" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dd26820a9f3637f1302da8bceba3ff33adbe53464b54ca24d4e2d4f1db30f94" +dependencies = [ + "once_cell", +] + +[[package]] +name = "futures-util" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a894a0acddba51a2d49a6f4263b1e64b8c579ece8af50fa86503d52cd1eea34" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-task", + "memchr", + "pin-project", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", ] [[package]] @@ -547,15 +525,36 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] @@ -568,89 +567,88 @@ dependencies = [ "lzw", ] -[[package]] -name = "gimli" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" - [[package]] name = "git2" -version = "0.7.5" +version = "0.13.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591f8be1674b421644b6c030969520bc3fa12114d2eb467471982ed3e9584e71" +checksum = "1e094214efbc7fdbbdee952147e493b00e99a4e52817492277e98967ae918165" dependencies = [ "bitflags", "libc", "libgit2-sys", "log", - "url 1.7.2", + "url", ] [[package]] name = "h2" -version = "0.1.26" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" dependencies = [ - "byteorder", - "bytes 0.4.12", + "bytes", "fnv", - "futures", + "futures-core", + "futures-sink", + "futures-util", "http", "indexmap", - "log", "slab", - "string", - "tokio-io", + "tokio", + "tokio-util", + "tracing", ] [[package]] name = "hashbrown" -version = "0.6.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" +checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" dependencies = [ "ahash", - "autocfg 0.1.7", + "autocfg", ] +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" + [[package]] name = "hermit-abi" -version = "0.1.13" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ "libc", ] [[package]] name = "hex" -version = "0.3.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" [[package]] name = "http" -version = "0.1.21" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" dependencies = [ - "bytes 0.4.12", + "bytes", "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ - "bytes 0.4.12", - "futures", + "bytes", "http", - "tokio-buf", ] [[package]] @@ -659,62 +657,50 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + [[package]] name = "hyper" -version = "0.12.35" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +checksum = "2f3afcfae8af5ad0576a31e768415edb627824129e8e5a29b8bfccb2f234e835" dependencies = [ - "bytes 0.4.12", - "futures", - "futures-cpupool", + "bytes", + "futures-channel", + "futures-core", + "futures-util", "h2", "http", "http-body", "httparse", - "iovec", + "httpdate", "itoa", - "log", - "net2", - "rustc_version", - "time 0.1.43", + "pin-project", + "socket2", "tokio", - "tokio-buf", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", + "tower-service", + "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.17.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719d85c7df4a7f309a77d145340a063ea929dcb2e025bae46a80345cffec2952" +checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6" dependencies = [ - "bytes 0.4.12", - "ct-logs", - "futures", + "bytes", + "futures-util", "hyper", + "log", "rustls", - "tokio-io", + "tokio", "tokio-rustls", "webpki", - "webpki-roots", -] - -[[package]] -name = "idna" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", ] [[package]] @@ -741,17 +727,18 @@ dependencies = [ "num-iter", "num-rational", "num-traits 0.1.43", - "png", + "png 0.11.0", "scoped_threadpool", ] [[package]] name = "indexmap" -version = "1.3.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" +checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" dependencies = [ - "autocfg 1.0.0", + "autocfg", + "hashbrown 0.9.1", ] [[package]] @@ -765,9 +752,9 @@ dependencies = [ [[package]] name = "io-enum" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "285762158c743ac75969bc8e9062ddcb013121d0c8aae32156740e621d2f3194" +checksum = "e467fc10409cca1c49840b62ccd7993463f2137cab21f863d917b316b2287336" dependencies = [ "derive_utils", "quote", @@ -783,17 +770,32 @@ dependencies = [ "libc", ] +[[package]] +name = "ipnet" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" + [[package]] name = "itoa" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" + +[[package]] +name = "jobserver" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +dependencies = [ + "libc", +] [[package]] name = "jpeg-decoder" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b47b4c4e017b01abdc5bcc126d2d1002e5a75bbe3ce73f9f4f311a916363704" +checksum = "cc797adac5f083b8ff0ca6f6294a999393d76e197c36488e2ef732c4715f6fa3" dependencies = [ "byteorder", "rayon", @@ -801,9 +803,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.39" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa5a448de267e7358beaf4a5d849518fe9a0c13fce7afd44b06e68550e5562a7" +checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" dependencies = [ "wasm-bindgen", ] @@ -849,15 +851,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.70" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" +checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743" [[package]] name = "libgit2-sys" -version = "0.7.11" +version = "0.12.13+1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48441cb35dc255da8ae72825689a95368bf510659ae1ad55dc4aa88cb1789bf1" +checksum = "069eea34f76ec15f2822ccf78fe0cdb8c9016764d0a12865278585a74dbdeae5" dependencies = [ "cc", "libc", @@ -867,9 +869,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.0.25" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" +checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ "cc", "libc", @@ -879,29 +881,29 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.4.8" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ "cfg-if", ] [[package]] name = "lru" -version = "0.4.4" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348b828e43d7d1d7a247a6ece0c041d95fb0e34d5496bb4c308428face25df6b" +checksum = "111b945ac72ec09eb7bc62a0fbdc3cc6e80555a7245f52a69d3921a75b53b153" dependencies = [ - "hashbrown", + "hashbrown 0.8.2", ] [[package]] @@ -922,6 +924,17 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +[[package]] +name = "md-5" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + [[package]] name = "memchr" version = "2.3.3" @@ -930,11 +943,11 @@ checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" [[package]] name = "memoffset" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "autocfg 1.0.0", + "autocfg", ] [[package]] @@ -955,13 +968,23 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" +checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" dependencies = [ "adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +dependencies = [ + "adler", + "autocfg", +] + [[package]] name = "mio" version = "0.6.22" @@ -995,8 +1018,9 @@ dependencies = [ [[package]] name = "mysql" -version = "18.2.0" -source = "git+https://github.com/blackbeam/rust-mysql-simple?rev=b039fe7a11609aeab9071289bcff496b9366389a#b039fe7a11609aeab9071289bcff496b9366389a" +version = "20.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07a360b3963beb8898d6c8ae85d149be065a924832c80bf21334dd3d77e0cf26" dependencies = [ "bufstream", "io-enum", @@ -1005,44 +1029,42 @@ dependencies = [ "mysql_common", "named_pipe", "native-tls", - "net2", "nix", - "percent-encoding 2.1.0", + "percent-encoding", "serde", "serde_json", + "socket2", "twox-hash", - "url 2.1.1", - "winapi 0.3.8", + "url", ] [[package]] name = "mysql_common" -version = "0.22.1" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d19114eee7404a04b8c936c721a2a41517c57e1b0780b1387a4a7d34e735abf" +checksum = "de63b87a5f24c5db252418a6f04abb2f62823bd838dc9b1d7fdb8ae972ef76cf" dependencies = [ - "base64 0.12.1", + "base64", "bigdecimal", "bitflags", "byteorder", - "bytes 0.5.4", + "bytes", "chrono", - "failure", "flate2", "lazy_static", "lexical", "num-bigint", - "num-traits 0.2.11", + "num-traits 0.2.12", "rand 0.7.3", "regex", "rust_decimal", "serde", "serde_json", "sha1", - "sha2", - "time 0.2.16", + "sha2 0.8.2", + "time 0.2.22", "twox-hash", - "uuid 0.8.1", + "uuid", ] [[package]] @@ -1051,7 +1073,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad9c443cce91fc3e12f017290db75dde490d685cdaaf508d7159d7cf41f0eb2b" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1074,26 +1096,25 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.34" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ "cfg-if", "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "nix" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" +checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" dependencies = [ "bitflags", "cc", "cfg-if", "libc", - "void", ] [[package]] @@ -1112,30 +1133,30 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.0.0", + "autocfg", "num-integer", - "num-traits 0.2.11", + "num-traits 0.2.12", ] [[package]] name = "num-integer" -version = "0.1.42" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" +checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" dependencies = [ - "autocfg 1.0.0", - "num-traits 0.2.11", + "autocfg", + "num-traits 0.2.12", ] [[package]] name = "num-iter" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb0800a0291891dd9f4fe7bd9c19384f98f7fbe0cd0f39a2c6b88b9868bbc00" +checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" dependencies = [ - "autocfg 1.0.0", + "autocfg", "num-integer", - "num-traits 0.2.11", + "num-traits 0.2.12", ] [[package]] @@ -1145,7 +1166,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" dependencies = [ "num-integer", - "num-traits 0.2.11", + "num-traits 0.2.12", ] [[package]] @@ -1154,16 +1175,16 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.11", + "num-traits 0.2.12", ] [[package]] name = "num-traits" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" dependencies = [ - "autocfg 1.0.0", + "autocfg", ] [[package]] @@ -1176,17 +1197,11 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" - [[package]] name = "once_cell" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" +checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" [[package]] name = "opaque-debug" @@ -1194,11 +1209,17 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "openssl" -version = "0.10.29" +version = "0.10.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee6d85f4cb4c4f59a6a85d5b68a233d280c82e29e822913b9c8b129fbf20bdd" +checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" dependencies = [ "bitflags", "cfg-if", @@ -1216,11 +1237,11 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" -version = "0.9.56" +version = "0.9.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f02309a7f127000ed50594f0b50ecc69e7c654e16d41b4e8156d1b3df8e0b52e" +checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" dependencies = [ - "autocfg 1.0.0", + "autocfg", "cc", "libc", "pkg-config", @@ -1228,48 +1249,48 @@ dependencies = [ ] [[package]] -name = "parking_lot" -version = "0.9.0" +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" dependencies = [ - "lock_api", - "parking_lot_core", - "rustc_version", + "pin-project-internal", ] [[package]] -name = "parking_lot_core" -version = "0.6.2" +name = "pin-project-internal" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" dependencies = [ - "cfg-if", - "cloudabi", - "libc", - "redox_syscall", - "rustc_version", - "smallvec 0.6.13", - "winapi 0.3.8", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "percent-encoding" -version = "1.0.1" +name = "pin-project-lite" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +checksum = "e555d9e657502182ac97b539fb3dae8b79cda19e3e4f8ffb5e8de4f18df93c95" [[package]] -name = "percent-encoding" -version = "2.1.0" +name = "pin-utils" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.17" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "png" @@ -1278,50 +1299,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0b0cabbbd20c2d7f06dbf015e06aad59b6ca3d9ed14848783e98af9aaf19925" dependencies = [ "bitflags", - "deflate", + "deflate 0.7.20", "inflate", "num-iter", ] +[[package]] +name = "png" +version = "0.16.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfe7f9f1c730833200b134370e1d5098964231af8450bce9b78ee3ab5278b970" +dependencies = [ + "bitflags", + "crc32fast", + "deflate 0.8.6", + "miniz_oxide 0.3.7", +] + [[package]] name = "ppv-lite86" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" [[package]] name = "proc-macro-hack" -version = "0.5.15" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" +checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598" [[package]] -name = "proc-macro2" -version = "1.0.17" +name = "proc-macro-nested" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1502d12e458c49a4c9cbff560d0fe0060c252bc29799ed94ca2ed4bb665a0101" -dependencies = [ - "unicode-xid", -] +checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" [[package]] -name = "publicsuffix" -version = "1.5.4" +name = "proc-macro2" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ - "error-chain", - "idna 0.2.0", - "lazy_static", - "regex", - "url 2.1.1", + "unicode-xid", ] [[package]] name = "quote" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ "proc-macro2", ] @@ -1336,49 +1362,20 @@ dependencies = [ "fuchsia-cprng", "libc", "rand_core 0.3.1", - "winapi 0.3.8", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", + "getrandom 0.1.15", + "libc", + "rand_chacha", + "rand_core 0.5.1", + "rand_hc", ] [[package]] @@ -1412,16 +1409,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", + "getrandom 0.1.15", ] [[package]] @@ -1433,65 +1421,13 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.8", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.8", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "rayon" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +checksum = "dcf6960dc9a5b4ee8d3e4c5787b4a112a8818e0290a42ff664ad60692fdf2032" dependencies = [ + "autocfg", "crossbeam-deque", "either", "rayon-core", @@ -1499,37 +1435,28 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +checksum = "e8c4fec834fb6e6d2dd5eece3c7b432a52f0ba887cf40e595190c4107edc08bf" dependencies = [ + "crossbeam-channel", "crossbeam-deque", - "crossbeam-queue", "crossbeam-utils", "lazy_static", "num_cpus", ] -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "regex" -version = "1.3.7" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" +checksum = "36f45b719a674bf4b828ff318906d6c133264c793eff7a41e30074a45b5099e2" dependencies = [ "aho-corasick", "memchr", @@ -1539,60 +1466,60 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.17" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" +checksum = "c17be88d9eaa858870aa5e48cc406c206e4600e983fc4f06bbe5750d93d09761" [[package]] name = "remove_dir_all" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "reqwest" -version = "0.9.24" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" +checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e" dependencies = [ - "base64 0.10.1", - "bytes 0.4.12", - "cookie", - "cookie_store", + "base64", + "bytes", "encoding_rs", - "flate2", - "futures", + "futures-core", + "futures-util", "http", + "http-body", "hyper", "hyper-rustls", + "ipnet", + "js-sys", + "lazy_static", "log", "mime", "mime_guess", + "percent-encoding", + "pin-project-lite", "rustls", "serde", - "serde_json", "serde_urlencoded", - "time 0.1.43", "tokio", - "tokio-executor", - "tokio-io", "tokio-rustls", - "tokio-threadpool", - "tokio-timer", - "url 1.7.2", - "uuid 0.7.4", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", "webpki-roots", "winreg", ] [[package]] name = "ring" -version = "0.16.13" +version = "0.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703516ae74571f24b465b4a1431e81e2ad51336cb0ded733a55a1aa3eccac196" +checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" dependencies = [ "cc", "libc", @@ -1600,46 +1527,44 @@ dependencies = [ "spin", "untrusted", "web-sys", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "rust-g" -version = "0.4.5" +version = "0.4.6" dependencies = [ "chrono", - "crypto-hash", - "failure", + "dashmap", + "flume", "git2", "hex", "lazy_static", + "md-5", "mysql", "noise", - "percent-encoding 1.0.1", - "png", + "once_cell", + "percent-encoding", + "png 0.16.7", "reqwest", "serde", - "serde_derive", "serde_json", - "url 2.1.1", + "sha-1", + "sha2 0.9.1", + "thiserror", + "url", ] [[package]] name = "rust_decimal" -version = "1.6.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b5f52edf35045e96b07aa29822bf4ce8495295fd5610270f85ab1f26df7ba5" +checksum = "c9e81662973c7a8d9663e64a0de4cd642b89a21d64966e3d99606efdc5fb0cc6" dependencies = [ - "num-traits 0.2.11", + "num-traits 0.2.12", "serde", ] -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1651,11 +1576,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.16.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" +checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" dependencies = [ - "base64 0.10.1", + "base64", "log", "ring", "sct", @@ -1664,9 +1589,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] name = "schannel" @@ -1675,7 +1600,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1740,18 +1665,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.110" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" +checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.110" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" +checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8" dependencies = [ "proc-macro2", "quote", @@ -1760,9 +1685,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.53" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993948e75b189211a9b31a7528f950c6adc21f9720b6438ff80a7fa2f864cea2" +checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" dependencies = [ "itoa", "ryu", @@ -1771,14 +1696,27 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" dependencies = [ "dtoa", "itoa", "serde", - "url 1.7.2", + "url", +] + +[[package]] +name = "sha-1" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a36ea86c864a3f16dd2687712dd6646f7019f301e57537c7f4dc9f5916770" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpuid-bool", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -1789,14 +1727,27 @@ checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "sha2" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", "fake-simd", - "opaque-debug", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpuid-bool", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -1806,31 +1757,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] -name = "smallvec" -version = "0.6.13" +name = "socket2" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" dependencies = [ - "maybe-uninit", + "cfg-if", + "libc", + "redox_syscall", + "winapi 0.3.9", ] -[[package]] -name = "smallvec" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" - [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spinning_top" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e529d73e80d64b5f2631f9035113347c578a1c9c7774b83a2b880788459ab36" +dependencies = [ + "lock_api", +] + [[package]] name = "standback" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47e4b8c631c998468961a9ea159f064c5c8499b95b5e4a34b77849d45949d540" +checksum = "f4e0831040d2cf2bdfd51b844be71885783d489898a192f254ae25d57cce725c" +dependencies = [ + "version_check", +] [[package]] name = "static_assertions" @@ -1887,35 +1847,14 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -dependencies = [ - "bytes 0.4.12", -] - [[package]] name = "syn" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b5f192649e48a5302a13f2feb224df883b98933222369e4b3b0fe2a5447269" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "synstructure" -version = "0.12.3" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +checksum = "e03e57e4fcbfe7749842d53e24ccb9aa12b7252dbe5e91d2acad31834c8b8fdd" dependencies = [ "proc-macro2", "quote", - "syn", "unicode-xid", ] @@ -1930,7 +1869,27 @@ dependencies = [ "rand 0.7.3", "redox_syscall", "remove_dir_all", - "winapi 0.3.8", + "winapi 0.3.9", +] + +[[package]] +name = "thiserror" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1944,34 +1903,35 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", - "winapi 0.3.8", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", ] [[package]] name = "time" -version = "0.2.16" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a51cadc5b1eec673a685ff7c33192ff7b7603d0b75446fb354939ee615acb15" +checksum = "55b7151c9065e80917fbf285d9a5d1432f60db41d170ccafc749a136b41a93af" dependencies = [ - "cfg-if", + "const_fn", "libc", "standback", "stdweb", "time-macros", "version_check", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "time-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9b6e9f095bc105e183e3cd493d72579be3181ad4004fceb01adbe9eecab2d" +checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" dependencies = [ "proc-macro-hack", "time-macros-impl", @@ -1991,166 +1951,87 @@ dependencies = [ ] [[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -dependencies = [ - "bytes 0.4.12", - "futures", - "mio", - "num_cpus", - "tokio-current-thread", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", -] - -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -dependencies = [ - "bytes 0.4.12", - "either", - "futures", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -dependencies = [ - "futures", - "tokio-executor", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -dependencies = [ - "crossbeam-utils", - "futures", -] - -[[package]] -name = "tokio-io" -version = "0.1.13" +name = "tinyvec" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -dependencies = [ - "bytes 0.4.12", - "futures", - "log", -] +checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" [[package]] -name = "tokio-reactor" -version = "0.1.12" +name = "tokio" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" dependencies = [ - "crossbeam-utils", - "futures", + "bytes", + "fnv", + "futures-core", + "iovec", "lazy_static", - "log", + "memchr", "mio", "num_cpus", - "parking_lot", + "pin-project-lite", "slab", - "tokio-executor", - "tokio-io", - "tokio-sync", ] [[package]] name = "tokio-rustls" -version = "0.10.3" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7cf08f990090abd6c6a73cab46fed62f85e8aef8b99e4b918a9f4a637f0676" +checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" dependencies = [ - "bytes 0.4.12", - "futures", - "iovec", + "futures-core", "rustls", - "tokio-io", + "tokio", "webpki", ] [[package]] -name = "tokio-sync" -version = "0.1.8" +name = "tokio-util" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" dependencies = [ - "fnv", - "futures", + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", ] [[package]] -name = "tokio-tcp" -version = "0.1.4" +name = "tower-service" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -dependencies = [ - "bytes 0.4.12", - "futures", - "iovec", - "mio", - "tokio-io", - "tokio-reactor", -] +checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" [[package]] -name = "tokio-threadpool" -version = "0.1.18" +name = "tracing" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils", - "futures", - "lazy_static", + "cfg-if", "log", - "num_cpus", - "slab", - "tokio-executor", + "pin-project-lite", + "tracing-core", ] [[package]] -name = "tokio-timer" -version = "0.2.13" +name = "tracing-core" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" dependencies = [ - "crossbeam-utils", - "futures", - "slab", - "tokio-executor", + "lazy_static", ] [[package]] name = "try-lock" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" - -[[package]] -name = "try_from" -version = "0.3.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" -dependencies = [ - "cfg-if", -] +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "twox-hash" @@ -2187,18 +2068,18 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" +checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" dependencies = [ - "smallvec 1.4.0", + "tinyvec", ] [[package]] name = "unicode-xid" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "untrusted" @@ -2206,35 +2087,15 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" -[[package]] -name = "url" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -dependencies = [ - "idna 0.1.5", - "matches", - "percent-encoding 1.0.1", -] - [[package]] name = "url" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" dependencies = [ - "idna 0.2.0", + "idna", "matches", - "percent-encoding 2.1.0", -] - -[[package]] -name = "uuid" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" -dependencies = [ - "rand 0.6.5", + "percent-encoding", ] [[package]] @@ -2245,29 +2106,22 @@ checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" [[package]] name = "vcpkg" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" +checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" [[package]] name = "version_check" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" - -[[package]] -name = "void" -version = "1.0.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "want" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "futures", "log", "try-lock", ] @@ -2278,21 +2132,29 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasm-bindgen" -version = "0.2.62" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c7d40d09cdbf0f4895ae58cf57d92e1e57a9dd8ed2e8390514b54a47cc5551" +checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" dependencies = [ "cfg-if", + "serde", + "serde_json", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.62" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3972e137ebf830900db522d6c8fd74d1900dcfc733462e9a12e942b00b4ac94" +checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" dependencies = [ "bumpalo", "lazy_static", @@ -2303,11 +2165,23 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" -version = "0.2.62" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cd85aa2c579e8892442954685f0d801f9129de24fa2136b2c6a539c76b65776" +checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2315,9 +2189,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.62" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb197bd3a47553334907ffd2f16507b4f4f01bbec3ac921a7719e0decdfe72a" +checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" dependencies = [ "proc-macro2", "quote", @@ -2328,15 +2202,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.62" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91c2916119c17a8e316507afaaa2dd94b47646048014bbdf6bef098c1bb58ad" +checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" [[package]] name = "web-sys" -version = "0.3.39" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bc359e5dd3b46cb9687a051d50a2fdd228e4ba7cf6fcf861a5365c3d671a642" +checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" dependencies = [ "js-sys", "wasm-bindgen", @@ -2344,9 +2218,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f50e1972865d6b1adb54167d1c8ed48606004c2c9d0ea5f1eeb34d95e863ef" +checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" dependencies = [ "ring", "untrusted", @@ -2354,9 +2228,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" +checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739" dependencies = [ "webpki", ] @@ -2369,9 +2243,9 @@ checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", @@ -2397,11 +2271,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winreg" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 5c68a95d..89fd48dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rust-g" edition = "2018" -version = "0.4.5" +version = "0.4.6" authors = ["Bjorn Neergaard "] repository = "https://github.com/tgstation/rust-g" license-file = "LICENSE" @@ -12,37 +12,39 @@ crate-type = ["cdylib"] [profile.release] opt-level = 3 +codegen-units = 1 lto = true [dependencies] -failure = "0.1" +thiserror = "1.0" +flume = "0.9" chrono = { version = "0.4", optional = true } -crypto-hash = { version = "0.3", optional = true } -hex = { version = "0.3", optional = true } -percent-encoding = { version = "1.0", optional = true } -url-dep = { version = "2.1.1", package = "url", optional = true } -png = { version = "0.11.0", optional = true } -git2 = { version = "0.7.1", optional = true, default-features = false } -noise = { version = "0.6.0", optional = true} -reqwest = { version = "0.9", optional = true, default-features = false, features = ["rustls-tls"] } -serde = { version = "1.0", optional = true } +md-5 = { version = "0.9", optional = true } +sha-1 = { version = "0.9", optional = true } +sha2 = { version = "0.9", optional = true } +hex = { version = "0.4", optional = true } +percent-encoding = { version = "2.1", optional = true } +url-dep = { version = "2.1", package = "url", optional = true } +png = { version = "0.16", optional = true } +git2 = { version = "0.13", optional = true, default-features = false } +noise = { version = "0.6", optional = true} +reqwest = { version = "0.10", optional = true, default-features = false, features = ["blocking", "rustls-tls"] } +serde = { version = "1.0", optional = true, features = ["derive"] } serde_json = { version = "1.0", optional = true } -serde_derive = { version = "1.0", optional = true } -lazy_static = { version = "1.3", optional = true } +lazy_static = { version = "1.4", optional = true } +once_cell = { version = "1.4", optional = true } +mysql = { version = "20.0", optional = true } +dashmap = { version = "3.11", optional = true } -[dependencies.mysql] -version = "18.2" -optional = true -git = "https://github.com/blackbeam/rust-mysql-simple" -rev = "b039fe7a11609aeab9071289bcff496b9366389a" [features] -default = ["dmi", "log", "git", "http", "sql", "noise"] +default = ["dmi", "log", "git", "http", "json", "sql", "noise"] dmi = ["png"] file = [] -hash = ["crypto-hash", "hex"] +hash = ["md-5", "sha-1", "sha2", "hex"] +json = ["serde", "serde_json"] log = ["chrono"] url = ["url-dep", "percent-encoding"] git = ["git2", "chrono"] -http = ["reqwest", "serde", "serde_json", "serde_derive", "lazy_static"] -sql = ["mysql", "serde", "serde_derive", "serde_json", "lazy_static"] +http = ["reqwest", "serde", "serde_json", "once_cell"] +sql = ["mysql", "serde", "serde_json", "once_cell", "dashmap"] diff --git a/README.md b/README.md index 37200ba0..b15ce1c1 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ The [Rust] compiler: # in the `rust-g` directory... cd rust-g # Linux - rustup override add stable-i686-unknown-linux-gnu + rustup target add i686-unknown-linux-gnu # Windows - rustup override add stable-i686-pc-windows-msvc + rustup target add i686-pc-windows-msvc ``` System libraries: @@ -61,7 +61,10 @@ compiling all Rust dependencies. The default configuration is suitable for use with the [tgstation] codebase, but not [beestation]. To compile in release mode: ```sh -cargo build --release +# Linux +cargo build --release --target=i686-unknown-linux-gnu +# Windows +cargo build --release --target=i686-pc-windows-msvc ``` On Linux, the output will be `target/release/librust_g.so`. @@ -71,7 +74,11 @@ On Windows, the output will be `target/release/rust_g.dll`. For more advanced configuration, a list of modules may be passed: ```sh -cargo build --release --features dmi,file,log,url,http +export PKG_CONFIG_ALLOW_CROSS=1 +# Linux +cargo build --release --target=i686-unknown-linux-gnu --features dmi,file,log,url,http +# Windows +cargo build --release --target=i686-pc-windows-msvc --features dmi,file,log,url,http ``` The default features are: @@ -81,11 +88,11 @@ The default features are: * git: Functions for robustly checking the current git revision. * http: Asynchronous HTTP(s) client supporting most standard methods. * sql: Asynchronous MySQL/MariaDB client library. +* noise: 2d Perlin noise. Additional features are: -* noise: 2d Perlin noise. * url: Faster replacements for `url_encode` and `url_decode`. -* file: Faster replacements for `file2text` and `text2file`. +* file: Faster replacements for `file2text` and `text2file`, as well as reading or checking if files exist. * hash: Faster replacement for `md5`, support for SHA-1, SHA-256, and SHA-512. Requires OpenSSL on Linux. ## Installing diff --git a/build.rs b/build.rs index 972108ce..f4a2bae2 100644 --- a/build.rs +++ b/build.rs @@ -82,6 +82,7 @@ fn main() { f, r#" #define rustg_file_read(fname) call(RUST_G, "file_read")(fname) +#define rustg_file_exists(fname) call(RUST_G, "file_exists")(fname) #define rustg_file_write(text, fname) call(RUST_G, "file_write")(text, fname) #define rustg_file_append(text, fname) call(RUST_G, "file_append")(text, fname) @@ -123,6 +124,17 @@ fn main() { "#).unwrap(); } + // module: json + if enabled!("JSON") { + write!( + f, + r#" +#define rustg_json_is_valid(text) (call(RUST_G, "json_is_valid")(text) == "true") +"# + ) + .unwrap(); + } + // module: log if enabled!("LOG") { write!( diff --git a/src/dmi.rs b/src/dmi.rs index f8df6e02..d642b191 100644 --- a/src/dmi.rs +++ b/src/dmi.rs @@ -1,5 +1,5 @@ use crate::error::{Error, Result}; -use png::{Decoder, Encoder, HasParameters, OutputInfo}; +use png::{Decoder, Encoder, OutputInfo}; use std::{ fs::{create_dir_all, File}, path::Path, @@ -28,7 +28,8 @@ fn read_png(path: &str) -> Result<(OutputInfo, Vec)> { fn write_png(path: &str, info: OutputInfo, image: Vec) -> Result<()> { let mut encoder = Encoder::new(File::create(path)?, info.width, info.height); - encoder.set(info.color_type).set(info.bit_depth); + encoder.set_color(info.color_type); + encoder.set_depth(info.bit_depth); let mut writer = encoder.write_header()?; Ok(writer.write_image_data(&image)?) @@ -57,8 +58,8 @@ fn create_png(path: &str, width: &str, height: &str, data: &str) -> Result<()> { } let mut encoder = Encoder::new(File::create(path)?, width, height); - encoder.set(png::ColorType::RGB); - encoder.set(png::BitDepth::Eight); + encoder.set_color(png::ColorType::RGB); + encoder.set_depth(png::BitDepth::Eight); let mut writer = encoder.write_header()?; Ok(writer.write_image_data(&result)?) } diff --git a/src/error.rs b/src/error.rs index b9233609..2ccfe27f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -4,93 +4,52 @@ use std::{ result, str::Utf8Error, }; +use thiserror::Error; #[cfg(feature = "png")] use png::{DecodingError, EncodingError}; pub type Result = result::Result; -#[derive(Fail, Debug)] +#[derive(Error, Debug)] pub enum Error { - #[fail(display = "Illegal null character in string.")] + #[error("Illegal null character in string.")] Null, - #[fail(display = "Invalid UTF-8 character at position {}.", _1)] - Utf8(#[cause] Utf8Error, usize), - #[fail(display = "Invalid or empty filename specified.")] + #[error("Invalid UTF-8 character at position {position}.")] + Utf8 { source: Utf8Error, position: usize }, + #[error("Invalid or empty filename specified.")] InvalidFilename, - #[fail(display = "{}", _0)] - Io(#[cause] io::Error), - #[fail(display = "Invalid algorithm specified.")] + #[error(transparent)] + Io(#[from] io::Error), + #[error("Invalid algorithm specified.")] InvalidAlgorithm, #[cfg(feature = "png")] - #[fail(display = "{}", _0)] - ImageDecoding(#[cause] DecodingError), + #[error(transparent)] + ImageDecoding(#[from] DecodingError), #[cfg(feature = "png")] - #[fail(display = "{}", _0)] - ImageEncoding(#[cause] EncodingError), - #[fail(display = "{}", _0)] - ParseIntError(#[cause] ParseIntError), - #[fail(display = "{}", _0)] - ParseFloatError(#[cause] ParseFloatError), + #[error(transparent)] + ImageEncoding(#[from] EncodingError), + #[error(transparent)] + ParseIntError(#[from] ParseIntError), + #[error(transparent)] + ParseFloatError(#[from] ParseFloatError), #[cfg(feature = "png")] - #[fail(display = "Invalid png data.")] + #[error("Invalid png data.")] InvalidPngDataError, #[cfg(feature = "http")] - #[fail(display = "{}", _0)] - RequestError(#[cause] reqwest::Error), + #[error(transparent)] + RequestError(#[from] reqwest::Error), #[cfg(feature = "http")] - #[fail(display = "{}", _0)] - SerializationError(#[cause] serde_json::Error), -} - -impl From for Error { - fn from(error: io::Error) -> Error { - Error::Io(error) - } + #[error(transparent)] + SerializationError(#[from] serde_json::Error), } impl From for Error { - fn from(error: Utf8Error) -> Error { - Error::Utf8(error, error.valid_up_to()) - } -} - -#[cfg(feature = "png")] -impl From for Error { - fn from(error: DecodingError) -> Error { - Error::ImageDecoding(error) - } -} - -#[cfg(feature = "png")] -impl From for Error { - fn from(error: EncodingError) -> Error { - Error::ImageEncoding(error) - } -} - -impl From for Error { - fn from(error: ParseIntError) -> Error { - Error::ParseIntError(error) - } -} - -impl From for Error { - fn from(error: ParseFloatError) -> Error { - Error::ParseFloatError(error) - } -} -#[cfg(feature = "http")] -impl From for Error { - fn from(error: reqwest::Error) -> Error { - Error::RequestError(error) - } -} - -#[cfg(feature = "http")] -impl From for Error { - fn from(error: serde_json::Error) -> Error { - Error::SerializationError(error) + fn from(source: Utf8Error) -> Error { + Error::Utf8 { + source, + position: source.valid_up_to(), + } } } diff --git a/src/file.rs b/src/file.rs index 75d30dae..947c738d 100644 --- a/src/file.rs +++ b/src/file.rs @@ -1,13 +1,17 @@ use crate::error::Result; use std::{ fs::{File, OpenOptions}, - io::{Read, Write}, + io::{BufReader, BufWriter, Read, Write}, }; byond_fn! { file_read(path) { read(path).ok() } } +byond_fn! { file_exists(path) { + Some(exists(path)) +} } + byond_fn! { file_write(data, path) { write(data, path).err() } } @@ -17,8 +21,9 @@ byond_fn! { file_append(data, path) { } } fn read(path: &str) -> Result { - let mut file = File::open(path)?; + let file = File::open(path)?; let metadata = file.metadata()?; + let mut file = BufReader::new(file); let mut content = String::with_capacity(metadata.len() as usize); file.read_to_string(&mut content)?; @@ -27,15 +32,26 @@ fn read(path: &str) -> Result { Ok(content) } +fn exists(path: &str) -> String { + let path = std::path::Path::new(path); + path.exists().to_string() +} + fn write(data: &str, path: &str) -> Result { let path: &std::path::Path = path.as_ref(); if let Some(parent) = path.parent() { std::fs::create_dir_all(parent)?; } - let mut file = File::create(path)?; + let mut file = BufWriter::new(File::create(path)?); + let written = file.write(data.as_bytes())?; + + file.flush()?; + file.into_inner() + .map_err(|e| std::io::Error::new(e.error().kind(), e.error().to_string()))? // This is god-awful, but the compiler REFUSES to let me get an owned copy of `e` + .sync_all()?; - Ok(file.write(data.as_bytes())?) + Ok(written) } fn append(data: &str, path: &str) -> Result { @@ -44,7 +60,13 @@ fn append(data: &str, path: &str) -> Result { std::fs::create_dir_all(parent)?; } - let mut file = OpenOptions::new().append(true).create(true).open(path)?; + let mut file = BufWriter::new(OpenOptions::new().append(true).create(true).open(path)?); + let written = file.write(data.as_bytes())?; + + file.flush()?; + file.into_inner() + .map_err(|e| std::io::Error::new(e.error().kind(), e.error().to_string()))? + .sync_all()?; - Ok(file.write(data.as_bytes())?) + Ok(written) } diff --git a/src/hash.rs b/src/hash.rs index 5ed58cd3..05e53098 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -1,6 +1,11 @@ use crate::error::{Error, Result}; -use crypto_hash::{Algorithm, Hasher}; -use std::{fs::File, io}; +use md5::Md5; +use sha1::Sha1; +use sha2::{Digest, Sha256, Sha512}; +use std::{ + fs::File, + io::{BufReader, Read}, +}; byond_fn! { hash_string(algorithm, string) { string_hash(algorithm, string).ok() @@ -10,31 +15,40 @@ byond_fn! { hash_file(algorithm, string) { file_hash(algorithm, string).ok() } } -fn get_algorithm(string: &str) -> Result { - let algorithm = match string { - "md5" => Algorithm::MD5, - "sha1" => Algorithm::SHA1, - "sha256" => Algorithm::SHA256, - "sha512" => Algorithm::SHA512, - _ => return Err(Error::InvalidAlgorithm), - }; - - Ok(algorithm) +fn hash_algorithm>(name: &str, bytes: B) -> Result { + match name { + "md5" => { + let mut hasher = Md5::new(); + hasher.update(bytes.as_ref()); + Ok(hex::encode(hasher.finalize())) + } + "sha1" => { + let mut hasher = Sha1::new(); + hasher.update(bytes.as_ref()); + Ok(hex::encode(hasher.finalize())) + } + "sha256" => { + let mut hasher = Sha256::new(); + hasher.update(bytes.as_ref()); + Ok(hex::encode(hasher.finalize())) + } + "sha512" => { + let mut hasher = Sha512::new(); + hasher.update(bytes.as_ref()); + Ok(hex::encode(hasher.finalize())) + } + _ => Err(Error::InvalidAlgorithm), + } } fn string_hash(algorithm: &str, string: &str) -> Result { - let algorithm = get_algorithm(algorithm)?; - let digest = crypto_hash::digest(algorithm, string.as_bytes()); - - Ok(hex::encode(digest)) + Ok(hash_algorithm(algorithm, string)?) } fn file_hash(algorithm: &str, path: &str) -> Result { - let algorithm = get_algorithm(algorithm)?; - - let mut file = File::open(path)?; - let mut digest = Hasher::new(algorithm); + let mut bytes: Vec = Vec::new(); + let mut file = BufReader::new(File::open(path)?); + file.read_to_end(&mut bytes)?; - io::copy(&mut file, &mut digest)?; - Ok(hex::encode(digest.finish())) + Ok(hash_algorithm(algorithm, &bytes)?) } diff --git a/src/http.rs b/src/http.rs index 394214a4..452f3d18 100644 --- a/src/http.rs +++ b/src/http.rs @@ -1,5 +1,8 @@ use crate::{error::Result, jobs}; +use once_cell::sync::Lazy; +use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, HashMap}; +use std::io::Write; // ---------------------------------------------------------------------------- // Interface @@ -58,10 +61,10 @@ byond_fn! { http_check_request(id) { const VERSION: &str = env!("CARGO_PKG_VERSION"); const PKG_NAME: &str = env!("CARGO_PKG_NAME"); -fn setup_http_client() -> reqwest::Client { +fn setup_http_client() -> reqwest::blocking::Client { use reqwest::{ + blocking::Client, header::{HeaderMap, USER_AGENT}, - Client, }; let mut headers = HeaderMap::new(); @@ -73,15 +76,13 @@ fn setup_http_client() -> reqwest::Client { Client::builder().default_headers(headers).build().unwrap() } -lazy_static! { - static ref HTTP_CLIENT: reqwest::Client = setup_http_client(); -} +static HTTP_CLIENT: Lazy = Lazy::new(setup_http_client); // ---------------------------------------------------------------------------- // Request construction and execution struct RequestPrep { - req: reqwest::RequestBuilder, + req: reqwest::blocking::RequestBuilder, output_filename: Option, } @@ -137,18 +138,21 @@ fn submit_request(prep: RequestPrep) -> Result { body: None, }; + let headers = response.headers().clone(); + for (key, value) in headers.iter() { + if let Ok(value) = value.to_str() { + resp.headers.insert(key.as_str(), value); + } + } + if let Some(output_filename) = prep.output_filename { - std::io::copy(&mut response, &mut std::fs::File::create(&output_filename)?)?; + let mut writer = std::io::BufWriter::new(std::fs::File::create(&output_filename)?); + std::io::copy(&mut response, &mut writer)?; + writer.flush()?; } else { body = response.text()?; resp.body = Some(&body); } - for (key, value) in response.headers().iter() { - if let Ok(value) = value.to_str() { - resp.headers.insert(key.as_str(), value); - } - } - Ok(serde_json::to_string(&resp)?) } diff --git a/src/jobs.rs b/src/jobs.rs index cd105b50..0d595a0a 100644 --- a/src/jobs.rs +++ b/src/jobs.rs @@ -1,13 +1,13 @@ //! Job system +use flume::Receiver; use std::{ cell::RefCell, collections::hash_map::{Entry, HashMap}, - sync::mpsc, thread, }; struct Job { - rx: mpsc::Receiver, + rx: Receiver, handle: thread::JoinHandle<()>, } @@ -26,7 +26,7 @@ struct Jobs { impl Jobs { fn start Output + Send + 'static>(&mut self, f: F) -> JobId { - let (tx, rx) = mpsc::channel(); + let (tx, rx) = flume::unbounded(); let handle = thread::spawn(move || { let _ = tx.send(f()); }); @@ -43,8 +43,8 @@ impl Jobs { }; let result = match entry.get().rx.try_recv() { Ok(result) => result, - Err(mpsc::TryRecvError::Disconnected) => JOB_PANICKED.to_owned(), - Err(mpsc::TryRecvError::Empty) => return NO_RESULTS_YET.to_owned(), + Err(flume::TryRecvError::Disconnected) => JOB_PANICKED.to_owned(), + Err(flume::TryRecvError::Empty) => return NO_RESULTS_YET.to_owned(), }; let _ = entry.remove().handle.join(); result diff --git a/src/json.rs b/src/json.rs new file mode 100644 index 00000000..2185e9d6 --- /dev/null +++ b/src/json.rs @@ -0,0 +1,75 @@ +use serde_json::Value; +use std::cmp; + +const VALID_JSON_MAX_RECURSION_DEPTH: usize = 8; + +byond_fn! { json_is_valid(text) { + let value = match serde_json::from_str::(text) { + Ok(value) => value, + Err(_) => return Some("false".to_owned()) + }; + + Some(get_recursion_level(&value).is_ok().to_string()) +} } + +/// Gets the recursion level of the given value +/// If it is above VALID_JSON_MAX_RECURSION_DEPTH, returns Err(()) +fn get_recursion_level(value: &Value) -> Result { + let values: Vec<&Value> = match value { + Value::Array(array) => array.iter().collect(), + + Value::Object(map) => map.values().collect(), + + _ => return Ok(0), + }; + + let mut max_recursion_level = 0; + + for value in values { + max_recursion_level = cmp::max(max_recursion_level, get_recursion_level(value)?); + } + + max_recursion_level += 1; + + if max_recursion_level >= VALID_JSON_MAX_RECURSION_DEPTH { + Err(()) + } else { + Ok(max_recursion_level) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_get_recursion_level() { + assert_eq!( + get_recursion_level(&serde_json::from_str("[]").unwrap()), + Ok(1) + ); + assert_eq!( + get_recursion_level(&serde_json::from_str("[[]]").unwrap()), + Ok(2) + ); + assert_eq!( + get_recursion_level(&serde_json::from_str("[[[]]]").unwrap()), + Ok(3) + ); + } + + #[test] + fn test_get_recursion_level_max_depth() { + assert_eq!( + get_recursion_level( + &serde_json::from_str(&format!( + "{}{}", + "[".repeat(VALID_JSON_MAX_RECURSION_DEPTH), + "]".repeat(VALID_JSON_MAX_RECURSION_DEPTH) + )) + .unwrap() + ), + Err(()) + ); + } +} diff --git a/src/lib.rs b/src/lib.rs index 02d498ba..eef27a0b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,33 +1,3 @@ -#[macro_use] -extern crate failure; - -#[cfg(feature = "chrono")] -extern crate chrono; -#[cfg(feature = "crypto-hash")] -extern crate crypto_hash; -#[cfg(feature = "git2")] -extern crate git2; -#[cfg(feature = "hex")] -extern crate hex; -#[cfg(feature = "noise")] -extern crate noise; -#[cfg(feature = "percent-encoding")] -extern crate percent_encoding; -#[cfg(feature = "png")] -extern crate png; -#[cfg(feature = "http")] -extern crate reqwest; -#[cfg(any(feature = "http", feature = "sql"))] -#[macro_use] -extern crate serde_derive; -#[cfg(any(feature = "http", feature = "sql"))] -extern crate serde_json; -#[cfg(any(feature = "http", feature = "sql"))] -#[macro_use] -extern crate lazy_static; -#[cfg(feature = "sql")] -extern crate mysql; - #[macro_use] mod byond; #[allow(dead_code)] @@ -44,6 +14,8 @@ pub mod git; pub mod hash; #[cfg(feature = "http")] pub mod http; +#[cfg(feature = "json")] +pub mod json; #[cfg(feature = "log")] pub mod log; #[cfg(feature = "noise")] diff --git a/src/sql.rs b/src/sql.rs index 57795621..9312540c 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -1,17 +1,21 @@ use crate::jobs; +use dashmap::DashMap; use mysql::{ consts::{ColumnFlags, ColumnType::*}, prelude::Queryable, OptsBuilder, Params, Pool, }; +use once_cell::sync::Lazy; +use serde::Deserialize; use serde_json::{json, map::Map, Number}; -use std::{collections::HashMap, error::Error, sync::RwLock, time::Duration}; +use std::sync::atomic::AtomicUsize; +use std::{error::Error, time::Duration}; // ---------------------------------------------------------------------------- // Interface const DEFAULT_PORT: u16 = 3306; -// The `mysql` crate defauls to 10 and 100 for these, but that is too large. +// The `mysql` crate defaults to 10 and 100 for these, but that is too large. const DEFAULT_MIN_THREADS: usize = 1; const DEFAULT_MAX_THREADS: usize = 10; @@ -60,37 +64,39 @@ byond_fn! { sql_query_async(handle, query, params) { // hopefully won't panic if queries are running byond_fn! { sql_disconnect_pool(handle) { - Some(match POOL.write() { - Ok(mut o) => { - match o.remove(handle) { - Some(_) => { - json!({ - "status": "success" - }).to_string() - }, - None => json!({ - "status": "offline" + let handle = match handle.parse::() { + Ok(o) => o, + Err(e) => return Some(err_to_json(e)), + }; + Some( + match POOL.remove(&handle) { + Some(_) => { + json!({ + "status": "success" }).to_string() - } - }, - Err(e) => err_to_json(e) - }) + }, + None => json!({ + "status": "offline" + }).to_string() + } + ) } } byond_fn! { sql_connected(handle) { - Some(match POOL.read() { - Ok(o) => { - match o.get(handle) { - Some(_) => json!({ - "status": "online" - }).to_string(), - None => json!({ - "status": "offline" - }).to_string() - } - }, - Err(e) => err_to_json(e) - }) + let handle = match handle.parse::() { + Ok(o) => o, + Err(e) => return Some(err_to_json(e)), + }; + Some( + match POOL.get(&handle) { + Some(_) => json!({ + "status": "online" + }).to_string(), + None => json!({ + "status": "offline" + }).to_string() + } + ) } } byond_fn! { sql_check_query(id) { @@ -100,10 +106,8 @@ byond_fn! { sql_check_query(id) { // ---------------------------------------------------------------------------- // Main connect and query implementation -lazy_static! { - static ref POOL: RwLock> = Default::default(); - static ref NEXT_ID: std::sync::atomic::AtomicUsize = Default::default(); -} +static POOL: Lazy> = Lazy::new(DashMap::new); +static NEXT_ID: AtomicUsize = AtomicUsize::new(0); fn sql_connect(options: ConnectOptions) -> Result> { let builder = OptsBuilder::new() @@ -124,21 +128,17 @@ fn sql_connect(options: ConnectOptions) -> Result Result> { let mut conn = { - let poolguard = POOL.read()?; - let pool = match poolguard.get(handle) { + let pool = match POOL.get(&handle.parse()?) { Some(s) => s, None => return Ok(json!({"status": "offline"})), }; @@ -190,7 +190,7 @@ fn do_query(handle: &str, query: &str, params: &str) -> Result serde_json::Value::Number( - Number::from_f64(f64::from(*f)).unwrap_or_else(|| Number::from(0)), + Number::from_f64(*f).unwrap_or_else(|| Number::from(0)), ), mysql::Value::Int(i) => serde_json::Value::Number(Number::from(*i)), mysql::Value::UInt(u) => serde_json::Value::Number(Number::from(*u)), diff --git a/src/url.rs b/src/url.rs index 10c94c42..be2179e1 100644 --- a/src/url.rs +++ b/src/url.rs @@ -17,7 +17,9 @@ fn encode(string: &str) -> String { fn decode(string: &str) -> Result { let replaced = replace_plus(string.as_bytes()); // into_owned() is not strictly necessary here, but saves some refactoring work. - Ok(percent_encoding::percent_decode(&replaced).decode_utf8_lossy().into_owned()) + Ok(percent_encoding::percent_decode(&replaced) + .decode_utf8_lossy() + .into_owned()) } // From `url` crate.