Merge pull request #54269 from bharatnc/ncb/update-tldLookup

update tldLookup data
This commit is contained in:
robot-ch-test-poll 2023-09-05 16:00:15 +02:00 committed by GitHub
commit 886a6e6e86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 72104 additions and 57075 deletions

View File

@ -22,6 +22,11 @@ if (USE_GPERF)
BYPRODUCTS "${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.gperf" BYPRODUCTS "${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.gperf"
) )
add_custom_target(generate-tldlookup ${GPERF} tldLookup.gperf --output-file=tldLookup.generated.cpp && clang-format -i tldLookup.generated.cpp add_custom_target(generate-tldlookup ${GPERF} tldLookup.gperf --output-file=tldLookup.generated.cpp && clang-format -i tldLookup.generated.cpp
# apply these clang-tidy fixes to the file generated by gperf:
# - use cstring since string.h is deprecated
# - return nullptr instead of 0
&& sed -i -e 's/\#include <string.h>/\#include <cstring>/g' tldLookup.generated.cpp -e 's/return 0\;/return nullptr\;/g' tldLookup.generated.cpp
SOURCES tldLookup.gperf SOURCES tldLookup.gperf
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# BYPRODUCTS "${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.generated.cpp" # BYPRODUCTS "${CMAKE_CURRENT_SOURCE_DIR}/tldLookup.generated.cpp"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,8 @@
[ ! -f public_suffix_list.dat ] && wget -nv -O public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat [ ! -f public_suffix_list.dat ] && wget -nv -O public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat
echo '%language=C++ echo '%language=C++
%define lookup-function-name is_valid %define lookup-function-name isValid
%define class-name tldLookupHash %define class-name TopLevelDomainLookupHash
%readonly-tables %readonly-tables
%includes %includes
%compare-strncmp %compare-strncmp

View File

@ -26,11 +26,11 @@ select cutToFirstSignificantSubdomainCustom('foo.kernel.biz.ss', 'public_suffix_
kernel.biz.ss kernel.biz.ss
select '-- difference'; select '-- difference';
-- difference -- difference
-- biz.ss is not in the default TLD list, hence: -- dev.ss is not in the default TLD list, hence:
select cutToFirstSignificantSubdomain('foo.kernel.biz.ss'); -- biz.ss select cutToFirstSignificantSubdomain('foo.kernel.dev.ss'); -- dev.ss
biz.ss dev.ss
select cutToFirstSignificantSubdomainCustom('foo.kernel.biz.ss', 'public_suffix_list'); -- kernel.biz.ss select cutToFirstSignificantSubdomainCustom('foo.kernel.dev.ss', 'public_suffix_list'); -- kernel.dev.ss
kernel.biz.ss dev.ss
select '-- 3+level'; select '-- 3+level';
-- 3+level -- 3+level
select cutToFirstSignificantSubdomainCustom('xx.blogspot.co.at', 'public_suffix_list'); -- xx.blogspot.co.at select cutToFirstSignificantSubdomainCustom('xx.blogspot.co.at', 'public_suffix_list'); -- xx.blogspot.co.at
@ -115,11 +115,11 @@ select cutToFirstSignificantSubdomainCustomRFC('foo.kernel.biz.ss', 'public_suff
kernel.biz.ss kernel.biz.ss
select '-- difference'; select '-- difference';
-- difference -- difference
-- biz.ss is not in the default TLD list, hence: -- dev.ss is not in the default TLD list, hence:
select cutToFirstSignificantSubdomainRFC('foo.kernel.biz.ss'); -- biz.ss select cutToFirstSignificantSubdomainRFC('foo.kernel.dev.ss'); -- dev.ss
biz.ss dev.ss
select cutToFirstSignificantSubdomainCustomRFC('foo.kernel.biz.ss', 'public_suffix_list'); -- kernel.biz.ss select cutToFirstSignificantSubdomainCustomRFC('foo.kernel.dev.ss', 'public_suffix_list'); -- kernel.dev.ss
kernel.biz.ss dev.ss
select '-- 3+level'; select '-- 3+level';
-- 3+level -- 3+level
select cutToFirstSignificantSubdomainCustomRFC('xx.blogspot.co.at', 'public_suffix_list'); -- xx.blogspot.co.at select cutToFirstSignificantSubdomainCustomRFC('xx.blogspot.co.at', 'public_suffix_list'); -- xx.blogspot.co.at

View File

@ -18,9 +18,9 @@ select firstSignificantSubdomainCustom{{ suffix }}('foo.kernel.biz.ss', 'public_
select cutToFirstSignificantSubdomainCustom{{ suffix }}('foo.kernel.biz.ss', 'public_suffix_list'); -- kernel.biz.ss select cutToFirstSignificantSubdomainCustom{{ suffix }}('foo.kernel.biz.ss', 'public_suffix_list'); -- kernel.biz.ss
select '-- difference'; select '-- difference';
-- biz.ss is not in the default TLD list, hence: -- dev.ss is not in the default TLD list, hence:
select cutToFirstSignificantSubdomain{{ suffix }}('foo.kernel.biz.ss'); -- biz.ss select cutToFirstSignificantSubdomain{{ suffix }}('foo.kernel.dev.ss'); -- dev.ss
select cutToFirstSignificantSubdomainCustom{{ suffix }}('foo.kernel.biz.ss', 'public_suffix_list'); -- kernel.biz.ss select cutToFirstSignificantSubdomainCustom{{ suffix }}('foo.kernel.dev.ss', 'public_suffix_list'); -- kernel.dev.ss
select '-- 3+level'; select '-- 3+level';
select cutToFirstSignificantSubdomainCustom{{ suffix }}('xx.blogspot.co.at', 'public_suffix_list'); -- xx.blogspot.co.at select cutToFirstSignificantSubdomainCustom{{ suffix }}('xx.blogspot.co.at', 'public_suffix_list'); -- xx.blogspot.co.at

View File

@ -1 +1 @@
biz.ss kernel.biz.ss dev.ss kernel.dev.ss

View File

@ -13,9 +13,9 @@ function clickhouse_local()
$CLICKHOUSE_LOCAL "${opts[@]}" "$@" $CLICKHOUSE_LOCAL "${opts[@]}" "$@"
} }
# -- biz.ss is not in the default TLD list, hence: # -- dev.ss is not in the default TLD list, hence:
clickhouse_local -q " clickhouse_local -q "
select select
cutToFirstSignificantSubdomain('foo.kernel.biz.ss'), cutToFirstSignificantSubdomain('foo.kernel.dev.ss'),
cutToFirstSignificantSubdomainCustom('foo.kernel.biz.ss', 'public_suffix_list') cutToFirstSignificantSubdomainCustom('foo.kernel.dev.ss', 'public_suffix_list')
" |& grep -v -e 'Processing configuration file' " |& grep -v -e 'Processing configuration file'