mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-10-29 06:15:38 +00:00
4 files changed
+22
-11
No files matched your search
@@ -75,3 +75,8 @@ option('with-upd', type: 'boolean',
|
|||||||
option('with-perl-legacy-api', type: 'boolean', value: false,
|
option('with-perl-legacy-api', type: 'boolean', value: false,
|
||||||
description: 'Enables the legacy IRC perl module for compatibility with old scripts'
|
description: 'Enables the legacy IRC perl module for compatibility with old scripts'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Build inputs
|
||||||
|
option('public-suffix-list', type: 'string', value: '',
|
||||||
|
description: 'Path to a local public_suffix_list.dat to generate the URL detection rules from instead of downloading it'
|
||||||
|
)
|
||||||
@@ -38,16 +38,16 @@ def main():
|
|||||||
if len(sys.argv) not in (2, 3):
|
if len(sys.argv) not in (2, 3):
|
||||||
raise SystemExit("usage: gen-public-suffix.py <output> [source]")
|
raise SystemExit("usage: gen-public-suffix.py <output> [source]")
|
||||||
output = Path(sys.argv[1])
|
output = Path(sys.argv[1])
|
||||||
sources = []
|
|
||||||
if len(sys.argv) == 3:
|
if len(sys.argv) == 3:
|
||||||
sources.append(Path(sys.argv[2]))
|
# An explicit source is authoritative, don't go online behind its back.
|
||||||
sources.extend(
|
rules = parse_rules(Path(sys.argv[2]).read_text(encoding="utf-8"))
|
||||||
[
|
emit_header(str(output), rules)
|
||||||
Path(__file__).with_name("public_suffix_list.dat"),
|
return
|
||||||
Path("/usr/share/publicsuffix/public_suffix_list.dat"),
|
sources = [
|
||||||
Path("/app/share/publicsuffix/public_suffix_list.dat"),
|
Path(__file__).with_name("public_suffix_list.dat"),
|
||||||
]
|
Path("/usr/share/publicsuffix/public_suffix_list.dat"),
|
||||||
)
|
Path("/app/share/publicsuffix/public_suffix_list.dat"),
|
||||||
|
]
|
||||||
data = None
|
data = None
|
||||||
for url in URLS:
|
for url in URLS:
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -110,9 +110,15 @@ make_te = find_program('make-te.py')
|
|||||||
|
|
||||||
python3 = find_program('python3', required: true)
|
python3 = find_program('python3', required: true)
|
||||||
|
|
||||||
|
public_suffix_cmd = [python3, files('gen-public-suffix.py'), '@OUTPUT@']
|
||||||
|
public_suffix_list = get_option('public-suffix-list')
|
||||||
|
if public_suffix_list != ''
|
||||||
|
public_suffix_cmd += public_suffix_list
|
||||||
|
endif
|
||||||
|
|
||||||
public_suffix_data = custom_target('public_suffix_data_h',
|
public_suffix_data = custom_target('public_suffix_data_h',
|
||||||
output: 'public_suffix_data.h',
|
output: 'public_suffix_data.h',
|
||||||
command: [python3, files('gen-public-suffix.py'), '@OUTPUT@']
|
command: public_suffix_cmd
|
||||||
)
|
)
|
||||||
|
|
||||||
emoji_data_table = custom_target('emoji_data_table_h',
|
emoji_data_table = custom_target('emoji_data_table_h',
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ net_resolve (netstore * ns, char *hostname, int port, char **real_host)
|
|||||||
sprintf (portstring, "%d", port);
|
sprintf (portstring, "%d", port);
|
||||||
|
|
||||||
memset (&hints, 0, sizeof (struct addrinfo));
|
memset (&hints, 0, sizeof (struct addrinfo));
|
||||||
hints.ai_family = PF_UNSPEC; /* support ipv6 and ipv4 */
|
hints.ai_family = AF_UNSPEC; /* support ipv6 and ipv4 */
|
||||||
hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
|
hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user