mirror of
https://github.com/mirror/wget.git
synced 2025-03-03 14:20:34 +08:00
[svn] Added (currently no-op) -4 and -6.
This commit is contained in:
parent
1c35fe3c45
commit
244efb6e50
@ -1,3 +1,7 @@
|
|||||||
|
2003-11-11 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
|
* main.c: Added options --inet4-only and --inet6-only.
|
||||||
|
|
||||||
2003-11-11 Hrvoje Niksic <hniksic@xemacs.org>
|
2003-11-11 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
* host.c (host_errstr): Use the more standard message "Unknown
|
* host.c (host_errstr): Use the more standard message "Unknown
|
||||||
|
18
src/host.c
18
src/host.c
@ -81,13 +81,6 @@ extern int h_errno;
|
|||||||
/* Mapping between known hosts and to lists of their addresses. */
|
/* Mapping between known hosts and to lists of their addresses. */
|
||||||
|
|
||||||
static struct hash_table *host_name_addresses_map;
|
static struct hash_table *host_name_addresses_map;
|
||||||
|
|
||||||
#ifdef ENABLE_IPV6
|
|
||||||
/* The IP family to request when connecting to remote hosts. This
|
|
||||||
should be moved to an entry in struct options when we implement the
|
|
||||||
--inet4/--inet6 flags. */
|
|
||||||
static int requested_family = AF_UNSPEC;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Lists of addresses. This should eventually be extended to handle
|
/* Lists of addresses. This should eventually be extended to handle
|
||||||
IPv6. */
|
IPv6. */
|
||||||
@ -537,7 +530,8 @@ lookup_host (const char *host, int silent)
|
|||||||
|
|
||||||
xzero (hints);
|
xzero (hints);
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
hints.ai_family = requested_family;
|
hints.ai_family = AF_UNSPEC; /* #### should look at opt.ipv4_only
|
||||||
|
and opt.ipv6_only */
|
||||||
hints.ai_flags = 0;
|
hints.ai_flags = 0;
|
||||||
|
|
||||||
err = getaddrinfo_with_timeout (host, NULL, &hints, &res, opt.dns_timeout);
|
err = getaddrinfo_with_timeout (host, NULL, &hints, &res, opt.dns_timeout);
|
||||||
@ -550,6 +544,11 @@ lookup_host (const char *host, int silent)
|
|||||||
}
|
}
|
||||||
al = address_list_from_addrinfo (res);
|
al = address_list_from_addrinfo (res);
|
||||||
freeaddrinfo (res);
|
freeaddrinfo (res);
|
||||||
|
if (!al)
|
||||||
|
{
|
||||||
|
logprintf (LOG_VERBOSE, _("failed: No IPv4/IPv6 addresses.\n"));
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
@ -619,7 +618,8 @@ lookup_host_passive (const char *host)
|
|||||||
|
|
||||||
xzero (hints);
|
xzero (hints);
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
hints.ai_family = requested_family;
|
hints.ai_family = AF_UNSPEC; /* #### should look at opt.ipv4_only
|
||||||
|
and opt.ipv6_only */
|
||||||
hints.ai_flags = AI_PASSIVE;
|
hints.ai_flags = AI_PASSIVE;
|
||||||
|
|
||||||
err = getaddrinfo (host, NULL, &hints, &res);
|
err = getaddrinfo (host, NULL, &hints, &res);
|
||||||
|
@ -167,6 +167,10 @@ static struct {
|
|||||||
{ "ignoretags", &opt.ignore_tags, cmd_vector },
|
{ "ignoretags", &opt.ignore_tags, cmd_vector },
|
||||||
{ "includedirectories", &opt.includes, cmd_directory_vector },
|
{ "includedirectories", &opt.includes, cmd_directory_vector },
|
||||||
{ "input", &opt.input_filename, cmd_file },
|
{ "input", &opt.input_filename, cmd_file },
|
||||||
|
#ifdef ENABLE_IPV6
|
||||||
|
{ "inet4only", &opt.ipv4_only, cmd_boolean },
|
||||||
|
{ "inet6only", &opt.ipv6_only, cmd_boolean },
|
||||||
|
#endif
|
||||||
{ "keepsessioncookies", &opt.keep_session_cookies, cmd_boolean },
|
{ "keepsessioncookies", &opt.keep_session_cookies, cmd_boolean },
|
||||||
{ "killlonger", &opt.kill_longer, cmd_boolean },
|
{ "killlonger", &opt.kill_longer, cmd_boolean },
|
||||||
{ "limitrate", &opt.limit_rate, cmd_bytes },
|
{ "limitrate", &opt.limit_rate, cmd_bytes },
|
||||||
|
@ -194,6 +194,8 @@ struct cmdline_option option_data[] =
|
|||||||
{ "ignore-length", 0, OPT_BOOLEAN, "ignorelength", -1 },
|
{ "ignore-length", 0, OPT_BOOLEAN, "ignorelength", -1 },
|
||||||
{ "ignore-tags", 0, OPT_VALUE, "ignoretags", -1 },
|
{ "ignore-tags", 0, OPT_VALUE, "ignoretags", -1 },
|
||||||
{ "include-directories", 'I', OPT_VALUE, "includedirectories", -1 },
|
{ "include-directories", 'I', OPT_VALUE, "includedirectories", -1 },
|
||||||
|
{ "inet4-only", '4', OPT_BOOLEAN, "inet4only", -1 },
|
||||||
|
{ "inet6-only", '6', OPT_BOOLEAN, "inet6only", -1 },
|
||||||
{ "input-file", 'i', OPT_VALUE, "input", -1 },
|
{ "input-file", 'i', OPT_VALUE, "input", -1 },
|
||||||
{ "keep-session-cookies", 0, OPT_BOOLEAN, "keepsessioncookies", -1 },
|
{ "keep-session-cookies", 0, OPT_BOOLEAN, "keepsessioncookies", -1 },
|
||||||
{ "level", 'l', OPT_VALUE, "reclevel", -1 },
|
{ "level", 'l', OPT_VALUE, "reclevel", -1 },
|
||||||
@ -396,7 +398,7 @@ Logging and input file:\n"),
|
|||||||
N_("\
|
N_("\
|
||||||
-v, --verbose be verbose (this is the default).\n"),
|
-v, --verbose be verbose (this is the default).\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-nv, --non-verbose turn off verboseness, without being quiet.\n"),
|
-nv, --no-verbose turn off verboseness, without being quiet.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
-i, --input-file=FILE download URLs found in FILE.\n"),
|
-i, --input-file=FILE download URLs found in FILE.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
@ -453,6 +455,10 @@ Download:\n"),
|
|||||||
--dns-cache=off disable caching DNS lookups.\n"),
|
--dns-cache=off disable caching DNS lookups.\n"),
|
||||||
N_("\
|
N_("\
|
||||||
--restrict-file-names=OS restrict chars in file names to ones OS allows.\n"),
|
--restrict-file-names=OS restrict chars in file names to ones OS allows.\n"),
|
||||||
|
N_("\
|
||||||
|
-4, --inet4-only connect only to IPv4 addresses.\n"),
|
||||||
|
N_("\
|
||||||
|
-6, --inet6-only connect only to IPv6 addresses.\n"),
|
||||||
"\n",
|
"\n",
|
||||||
|
|
||||||
N_("\
|
N_("\
|
||||||
|
@ -199,6 +199,11 @@ struct options
|
|||||||
|
|
||||||
int preserve_perm; /* whether remote permissions are used
|
int preserve_perm; /* whether remote permissions are used
|
||||||
or that what is set by umask. */
|
or that what is set by umask. */
|
||||||
|
|
||||||
|
#ifdef ENABLE_IPV6
|
||||||
|
int ipv4_only; /* IPv4 connections have been requested. */
|
||||||
|
int ipv6_only; /* IPv4 connections have been requested. */
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct options opt;
|
extern struct options opt;
|
||||||
|
Loading…
Reference in New Issue
Block a user