mirror of
https://github.com/mirror/wget.git
synced 2025-01-09 20:00:59 +08:00
[svn] Don't allow opt.ipv4_only and opt.ipv6_only to both be set.
This commit is contained in:
parent
dcc890b007
commit
66cc6d43f6
@ -1,3 +1,11 @@
|
|||||||
|
2003-11-16 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
|
* main.c (main): Don't allow setting of both opt.ipv4_only and
|
||||||
|
opt.ipv6_only.
|
||||||
|
|
||||||
|
* init.c (defaults): Mark opt.ipv4_only specially when set
|
||||||
|
automatically.
|
||||||
|
|
||||||
2003-11-15 Hrvoje Niksic <hniksic@xemacs.org>
|
2003-11-15 Hrvoje Niksic <hniksic@xemacs.org>
|
||||||
|
|
||||||
* host.c (lookup_host): Use AI_ADDRCONFIG only if the family is
|
* host.c (lookup_host): Use AI_ADDRCONFIG only if the family is
|
||||||
|
@ -321,7 +321,8 @@ defaults (void)
|
|||||||
{
|
{
|
||||||
int sock = socket (AF_INET6, SOCK_STREAM, 0);
|
int sock = socket (AF_INET6, SOCK_STREAM, 0);
|
||||||
if (sock < 0)
|
if (sock < 0)
|
||||||
opt.ipv4_only = 1;
|
opt.ipv4_only = -1; /* special value -1 because the option
|
||||||
|
was not specified by the user. */
|
||||||
else
|
else
|
||||||
close (sock);
|
close (sock);
|
||||||
}
|
}
|
||||||
|
12
src/main.c
12
src/main.c
@ -806,6 +806,18 @@ Can't timestamp and not clobber old files at the same time.\n"));
|
|||||||
print_usage ();
|
print_usage ();
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
if (opt.ipv4_only && opt.ipv6_only)
|
||||||
|
{
|
||||||
|
if (opt.ipv4_only == -1)
|
||||||
|
/* ipv4_only was set automatically because the system doesn't
|
||||||
|
support IPv6. */
|
||||||
|
printf (_("Cannot use --inet6-only on a system without IPv6 support.\n"));
|
||||||
|
else
|
||||||
|
printf (_("Cannot specify both --inet4-only and --inet6-only.\n"));
|
||||||
|
print_usage ();
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
nurl = argc - optind;
|
nurl = argc - optind;
|
||||||
if (!nurl && !opt.input_filename)
|
if (!nurl && !opt.input_filename)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user