From 3e56dca65bed68808e7d313598222b59fb9ea945 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 22 May 2023 14:24:38 -0400 Subject: [PATCH 1/2] chore: update ada to v2.4.2 --- deps/ada.cpp | 42 +++++++++++++----------------------------- deps/ada.h | 11 ++++++----- 2 files changed, 19 insertions(+), 34 deletions(-) diff --git a/deps/ada.cpp b/deps/ada.cpp index e0ee4a5..1759de2 100644 --- a/deps/ada.cpp +++ b/deps/ada.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2023-05-16 13:48:47 -0400. Do not edit! */ +/* auto-generated on 2023-05-19 00:02:33 -0400. Do not edit! */ /* begin file src/ada.cpp */ #include "ada.h" /* begin file src/checkers.cpp */ @@ -10001,8 +10001,9 @@ static_assert(sizeof(is_forbidden_domain_code_point_table_or_upper) == 256); static_assert(is_forbidden_domain_code_point_table_or_upper[uint8_t('A')] == 2); static_assert(is_forbidden_domain_code_point_table_or_upper[uint8_t('Z')] == 2); -ada_really_inline constexpr bool contains_forbidden_domain_code_point_or_upper( - const char* input, size_t length) noexcept { +ada_really_inline constexpr uint8_t +contains_forbidden_domain_code_point_or_upper(const char* input, + size_t length) noexcept { size_t i = 0; uint8_t accumulator{}; for (; i + 4 <= length; i += 4) { @@ -10677,7 +10678,7 @@ ada_really_inline size_t find_next_host_delimiter_special( has_zero_byte(xor3) | has_zero_byte(xor4) | has_zero_byte(xor5); if (is_match) { - return i + index_of_first_set_byte(is_match); + return size_t(i + index_of_first_set_byte(is_match)); } } if (i < view.size()) { @@ -10695,7 +10696,7 @@ ada_really_inline size_t find_next_host_delimiter_special( has_zero_byte(xor3) | has_zero_byte(xor4) | has_zero_byte(xor5); if (is_match) { - return i + index_of_first_set_byte(is_match); + return size_t(i + index_of_first_set_byte(is_match)); } } return view.size(); @@ -10739,7 +10740,7 @@ ada_really_inline size_t find_next_host_delimiter(std::string_view view, uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor4) | has_zero_byte(xor5); if (is_match) { - return i + index_of_first_set_byte(is_match); + return size_t(i + index_of_first_set_byte(is_match)); } } if (i < view.size()) { @@ -10757,7 +10758,7 @@ ada_really_inline size_t find_next_host_delimiter(std::string_view view, uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor4) | has_zero_byte(xor5); if (is_match) { - return i + index_of_first_set_byte(is_match); + return size_t(i + index_of_first_set_byte(is_match)); } } return view.size(); @@ -11064,7 +11065,7 @@ find_authority_delimiter_special(std::string_view view) noexcept { uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3) | has_zero_byte(xor4); if (is_match) { - return i + index_of_first_set_byte(is_match); + return size_t(i + index_of_first_set_byte(is_match)); } } @@ -11079,7 +11080,7 @@ find_authority_delimiter_special(std::string_view view) noexcept { uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3) | has_zero_byte(xor4); if (is_match) { - return i + index_of_first_set_byte(is_match); + return size_t(i + index_of_first_set_byte(is_match)); } } @@ -11112,7 +11113,7 @@ find_authority_delimiter(std::string_view view) noexcept { uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); if (is_match) { - return i + index_of_first_set_byte(is_match); + return size_t(i + index_of_first_set_byte(is_match)); } } @@ -11126,7 +11127,7 @@ find_authority_delimiter(std::string_view view) noexcept { uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); if (is_match) { - return i + index_of_first_set_byte(is_match); + return size_t(i + index_of_first_set_byte(is_match)); } } @@ -12088,8 +12089,7 @@ result_type parse_url(std::string_view user_input, // We refuse to parse URL strings that exceed 4GB. Such strings are almost // surely the result of a bug or are otherwise a security concern. - if (user_input.size() >= - std::string_view::size_type(std::numeric_limits::max)) { + if (user_input.size() > std::numeric_limits::max()) { url.is_valid = false; } // Going forward, user_input.size() is in [0, @@ -13565,22 +13565,6 @@ ada_really_inline bool url_aggregator::parse_host(std::string_view input) { } ada_log("parse_host fast path ", get_hostname()); return true; - } else if (is_forbidden_or_upper == 2) { - // We have encountered at least one upper case ASCII letter, let us - // try to convert it to lower case. If there is no 'xn-' in the result, - // we can then use a secondary fast path. - std::string _buffer = std::string(input); - unicode::to_lower_ascii(_buffer.data(), _buffer.size()); - if (input.find("xn-") == std::string_view::npos) { - // secondary fast path when input is not all lower case - update_base_hostname(input); - if (checkers::is_ipv4(get_hostname())) { - ada_log("parse_host fast path ipv4"); - return parse_ipv4(get_hostname()); - } - ada_log("parse_host fast path ", get_hostname()); - return true; - } } // We have encountered at least one forbidden code point or the input contains // 'xn-' (case insensitive), so we need to call 'to_ascii' to perform the full diff --git a/deps/ada.h b/deps/ada.h index 5afa7ab..cd9a69a 100644 --- a/deps/ada.h +++ b/deps/ada.h @@ -1,4 +1,4 @@ -/* auto-generated on 2023-05-16 13:48:47 -0400. Do not edit! */ +/* auto-generated on 2023-05-19 00:02:33 -0400. Do not edit! */ /* begin file include/ada.h */ /** * @file ada.h @@ -4354,8 +4354,9 @@ ada_really_inline constexpr bool contains_forbidden_domain_code_point( * then the second bit is set to 1. * @see https://url.spec.whatwg.org/#forbidden-domain-code-point */ -ada_really_inline constexpr bool contains_forbidden_domain_code_point_or_upper( - const char* input, size_t length) noexcept; +ada_really_inline constexpr uint8_t +contains_forbidden_domain_code_point_or_upper(const char* input, + size_t length) noexcept; /** * Checks if the input is a forbidden doamin code point. @@ -6484,14 +6485,14 @@ inline std::ostream &operator<<(std::ostream &out, #ifndef ADA_ADA_VERSION_H #define ADA_ADA_VERSION_H -#define ADA_VERSION "2.4.1" +#define ADA_VERSION "2.4.2" namespace ada { enum { ADA_VERSION_MAJOR = 2, ADA_VERSION_MINOR = 4, - ADA_VERSION_REVISION = 1, + ADA_VERSION_REVISION = 2, }; } // namespace ada From 22ab0999a783ff4c4b179e16953147dda8716199 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 22 May 2023 14:25:51 -0400 Subject: [PATCH 2/2] chore: release 1.0.1 --- Cargo.lock | 46 +++++++++++++++++++++++----------------------- Cargo.toml | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 167ccbd..684d946 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "ada-url" -version = "1.0.0" +version = "1.0.1" dependencies = [ "cc", "criterion", @@ -287,9 +287,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.62" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] @@ -403,9 +403,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" dependencies = [ "unicode-ident", ] @@ -479,18 +479,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.162" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.162" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", @@ -510,9 +510,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" dependencies = [ "proc-macro2", "quote", @@ -614,9 +614,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -624,9 +624,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", @@ -639,9 +639,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -649,9 +649,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", @@ -662,15 +662,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "web-sys" -version = "0.3.62" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index ea3f709..1f78d1d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ authors = [ "LongYinan ", "Boshen " ] -version = "1.0.0" +version = "1.0.1" edition = "2021" description = "Fast WHATWG Compliant URL parser" readme = "README.md"