| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a4ee1f6 commit 075b6db
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - /* auto-generated on 2023-05-16 13:48:47 -0400. Do not edit! */ | ||
| 1 | + /* auto-generated on 2023-05-19 00:02:33 -0400. Do not edit! */ | ||
| 2 | 2 | /* begin file src/ada.cpp */ | |
| 3 | 3 | #include "ada.h" | |
| 4 | 4 | /* begin file src/checkers.cpp */ | |
@@ -10001,8 +10001,9 @@ static_assert(sizeof(is_forbidden_domain_code_point_table_or_upper) == 256); | |||
| 10001 | 10001 | static_assert(is_forbidden_domain_code_point_table_or_upper[uint8_t('A')] == 2); | |
| 10002 | 10002 | static_assert(is_forbidden_domain_code_point_table_or_upper[uint8_t('Z')] == 2); | |
| 10003 | 10003 | ||
| 10004 | - ada_really_inline constexpr bool contains_forbidden_domain_code_point_or_upper( | ||
| 10005 | - const char* input, size_t length) noexcept { | ||
| 10004 | + ada_really_inline constexpr uint8_t | ||
| 10005 | + contains_forbidden_domain_code_point_or_upper(const char* input, | ||
| 10006 | + size_t length) noexcept { | ||
| 10006 | 10007 | size_t i = 0; | |
| 10007 | 10008 | uint8_t accumulator{}; | |
| 10008 | 10009 | for (; i + 4 <= length; i += 4) { | |
@@ -10677,7 +10678,7 @@ ada_really_inline size_t find_next_host_delimiter_special( | |||
| 10677 | 10678 | has_zero_byte(xor3) | has_zero_byte(xor4) | | |
| 10678 | 10679 | has_zero_byte(xor5); | |
| 10679 | 10680 | if (is_match) { | |
| 10680 | - return i + index_of_first_set_byte(is_match); | ||
| 10681 | + return size_t(i + index_of_first_set_byte(is_match)); | ||
| 10681 | 10682 | } | |
| 10682 | 10683 | } | |
| 10683 | 10684 | if (i < view.size()) { | |
@@ -10695,7 +10696,7 @@ ada_really_inline size_t find_next_host_delimiter_special( | |||
| 10695 | 10696 | has_zero_byte(xor3) | has_zero_byte(xor4) | | |
| 10696 | 10697 | has_zero_byte(xor5); | |
| 10697 | 10698 | if (is_match) { | |
| 10698 | - return i + index_of_first_set_byte(is_match); | ||
| 10699 | + return size_t(i + index_of_first_set_byte(is_match)); | ||
| 10699 | 10700 | } | |
| 10700 | 10701 | } | |
| 10701 | 10702 | return view.size(); | |
@@ -10739,7 +10740,7 @@ ada_really_inline size_t find_next_host_delimiter(std::string_view view, | |||
| 10739 | 10740 | uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | | |
| 10740 | 10741 | has_zero_byte(xor4) | has_zero_byte(xor5); | |
| 10741 | 10742 | if (is_match) { | |
| 10742 | - return i + index_of_first_set_byte(is_match); | ||
| 10743 | + return size_t(i + index_of_first_set_byte(is_match)); | ||
| 10743 | 10744 | } | |
| 10744 | 10745 | } | |
| 10745 | 10746 | if (i < view.size()) { | |
@@ -10757,7 +10758,7 @@ ada_really_inline size_t find_next_host_delimiter(std::string_view view, | |||
| 10757 | 10758 | uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | | |
| 10758 | 10759 | has_zero_byte(xor4) | has_zero_byte(xor5); | |
| 10759 | 10760 | if (is_match) { | |
| 10760 | - return i + index_of_first_set_byte(is_match); | ||
| 10761 | + return size_t(i + index_of_first_set_byte(is_match)); | ||
| 10761 | 10762 | } | |
| 10762 | 10763 | } | |
| 10763 | 10764 | return view.size(); | |
@@ -11064,7 +11065,7 @@ find_authority_delimiter_special(std::string_view view) noexcept { | |||
| 11064 | 11065 | uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | | |
| 11065 | 11066 | has_zero_byte(xor3) | has_zero_byte(xor4); | |
| 11066 | 11067 | if (is_match) { | |
| 11067 | - return i + index_of_first_set_byte(is_match); | ||
| 11068 | + return size_t(i + index_of_first_set_byte(is_match)); | ||
| 11068 | 11069 | } | |
| 11069 | 11070 | } | |
| 11070 | 11071 | ||
@@ -11079,7 +11080,7 @@ find_authority_delimiter_special(std::string_view view) noexcept { | |||
| 11079 | 11080 | uint64_t is_match = has_zero_byte(xor1) | has_zero_byte(xor2) | | |
| 11080 | 11081 | has_zero_byte(xor3) | has_zero_byte(xor4); | |
| 11081 | 11082 | if (is_match) { | |
| 11082 | - return i + index_of_first_set_byte(is_match); | ||
| 11083 | + return size_t(i + index_of_first_set_byte(is_match)); | ||
| 11083 | 11084 | } | |
| 11084 | 11085 | } | |
| 11085 | 11086 | ||
@@ -11112,7 +11113,7 @@ find_authority_delimiter(std::string_view view) noexcept { | |||
| 11112 | 11113 | uint64_t is_match = | |
| 11113 | 11114 | has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); | |
| 11114 | 11115 | if (is_match) { | |
| 11115 | - return i + index_of_first_set_byte(is_match); | ||
| 11116 | + return size_t(i + index_of_first_set_byte(is_match)); | ||
| 11116 | 11117 | } | |
| 11117 | 11118 | } | |
| 11118 | 11119 | ||
@@ -11126,7 +11127,7 @@ find_authority_delimiter(std::string_view view) noexcept { | |||
| 11126 | 11127 | uint64_t is_match = | |
| 11127 | 11128 | has_zero_byte(xor1) | has_zero_byte(xor2) | has_zero_byte(xor3); | |
| 11128 | 11129 | if (is_match) { | |
| 11129 | - return i + index_of_first_set_byte(is_match); | ||
| 11130 | + return size_t(i + index_of_first_set_byte(is_match)); | ||
| 11130 | 11131 | } | |
| 11131 | 11132 | } | |
| 11132 | 11133 | ||
@@ -12088,8 +12089,7 @@ result_type parse_url(std::string_view user_input, | |||
| 12088 | 12089 | ||
| 12089 | 12090 | // We refuse to parse URL strings that exceed 4GB. Such strings are almost | |
| 12090 | 12091 | // surely the result of a bug or are otherwise a security concern. | |
| 12091 | - if (user_input.size() >= | ||
| 12092 | - std::string_view::size_type(std::numeric_limits<uint32_t>::max)) { | ||
| 12092 | + if (user_input.size() > std::numeric_limits<uint32_t>::max()) { | ||
| 12093 | 12093 | url.is_valid = false; | |
| 12094 | 12094 | } | |
| 12095 | 12095 | // Going forward, user_input.size() is in [0, | |
@@ -13565,22 +13565,6 @@ ada_really_inline bool url_aggregator::parse_host(std::string_view input) { | |||
| 13565 | 13565 | } | |
| 13566 | 13566 | ada_log("parse_host fast path ", get_hostname()); | |
| 13567 | 13567 | return true; | |
| 13568 | - } else if (is_forbidden_or_upper == 2) { | ||
| 13569 | - // We have encountered at least one upper case ASCII letter, let us | ||
| 13570 | - // try to convert it to lower case. If there is no 'xn-' in the result, | ||
| 13571 | - // we can then use a secondary fast path. | ||
| 13572 | - std::string _buffer = std::string(input); | ||
| 13573 | - unicode::to_lower_ascii(_buffer.data(), _buffer.size()); | ||
| 13574 | - if (input.find("xn-") == std::string_view::npos) { | ||
| 13575 | - // secondary fast path when input is not all lower case | ||
| 13576 | - update_base_hostname(input); | ||
| 13577 | - if (checkers::is_ipv4(get_hostname())) { | ||
| 13578 | - ada_log("parse_host fast path ipv4"); | ||
| 13579 | - return parse_ipv4(get_hostname()); | ||
| 13580 | - } | ||
| 13581 | - ada_log("parse_host fast path ", get_hostname()); | ||
| 13582 | - return true; | ||
| 13583 | - } | ||
| 13584 | 13568 | } | |
| 13585 | 13569 | // We have encountered at least one forbidden code point or the input contains | |
| 13586 | 13570 | // 'xn-' (case insensitive), so we need to call 'to_ascii' to perform the full | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - /* auto-generated on 2023-05-16 13:48:47 -0400. Do not edit! */ | ||
| 1 | + /* auto-generated on 2023-05-19 00:02:33 -0400. Do not edit! */ | ||
| 2 | 2 | /* begin file include/ada.h */ | |
| 3 | 3 | /** | |
| 4 | 4 | * @file ada.h | |
@@ -4354,8 +4354,9 @@ ada_really_inline constexpr bool contains_forbidden_domain_code_point( | |||
| 4354 | 4354 | * then the second bit is set to 1. | |
| 4355 | 4355 | * @see https://url.spec.whatwg.org/#forbidden-domain-code-point | |
| 4356 | 4356 | */ | |
| 4357 | - ada_really_inline constexpr bool contains_forbidden_domain_code_point_or_upper( | ||
| 4358 | - const char* input, size_t length) noexcept; | ||
| 4357 | + ada_really_inline constexpr uint8_t | ||
| 4358 | + contains_forbidden_domain_code_point_or_upper(const char* input, | ||
| 4359 | + size_t length) noexcept; | ||
| 4359 | 4360 | ||
| 4360 | 4361 | /** | |
| 4361 | 4362 | * Checks if the input is a forbidden doamin code point. | |
@@ -6484,14 +6485,14 @@ inline std::ostream &operator<<(std::ostream &out, | |||
| 6484 | 6485 | #ifndef ADA_ADA_VERSION_H | |
| 6485 | 6486 | #define ADA_ADA_VERSION_H | |
| 6486 | 6487 | ||
| 6487 | - #define ADA_VERSION "2.4.1" | ||
| 6488 | + #define ADA_VERSION "2.4.2" | ||
| 6488 | 6489 | ||
| 6489 | 6490 | namespace ada { | |
| 6490 | 6491 | ||
| 6491 | 6492 | enum { | |
| 6492 | 6493 | ADA_VERSION_MAJOR = 2, | |
| 6493 | 6494 | ADA_VERSION_MINOR = 4, | |
| 6494 | - ADA_VERSION_REVISION = 1, | ||
| 6495 | + ADA_VERSION_REVISION = 2, | ||
| 6495 | 6496 | }; | |
| 6496 | 6497 | ||
| 6497 | 6498 | } // namespace ada | |
| Back | FazBrowse Home | New Git URL |
0 commit comments