RE: windows devel binary

2003-11-17 Thread Herold Heiko
 From: Hrvoje Niksic [mailto:[EMAIL PROTECTED]

  This is a binary compiled and run on windows nt 4, which 
 doesn't support
  IPV6, so the -4 should probably be a no-op ?
 
 Or not work at all.
 


I was thinking (rather late, I see you have changed other IPV6 stuff in the
meantime), why cut the -4 switch if no IPV6 is present ? The principle of
least surprise would say leave the switch there in order to avoid a unknown
switch error.

Suppose you have a bunch of machines, some with, some without IPV6 support.
You always want to enforce IPV4 usage. With a -4 switch always supported a
simple wget -4 would do the trick in any script used on all those machines.
Without that you'd need to have some mean to detect the IPV6 support and
change the wget switches used accordingly.

Same thing for -6 in fact - leave the switch even if no IPV6 is present and
supported, die with a meaningful error message (much better than a unknown
switch failure).

Heiko

-- 
-- PREVINET S.p.A. www.previnet.it
-- Heiko Herold [EMAIL PROTECTED]
-- +39-041-5907073 ph
-- +39-041-5907472 fax


Re: windows devel binary

2003-11-17 Thread Hrvoje Niksic
Herold Heiko [EMAIL PROTECTED] writes:

 From: Hrvoje Niksic [mailto:[EMAIL PROTECTED]

  This is a binary compiled and run on windows nt 4, which 
 doesn't support
  IPV6, so the -4 should probably be a no-op ?
 
 Or not work at all.

 I was thinking (rather late, I see you have changed other IPV6 stuff in the
 meantime),

Not late at all, this stuff is still very much in flux, and Mauro
might still come and change it again.  (He was to implement -4 and -6,
but he was very busy with other things so I went ahead and provided a
reference implementation which he's free to ignore.)

 why cut the -4 switch if no IPV6 is present ? The principle of least
 surprise would say leave the switch there in order to avoid a
 unknown switch error.

 Suppose you have a bunch of machines, some with, some without IPV6
 support.  You always want to enforce IPV4 usage. With a -4 switch
 always supported a simple wget -4 would do the trick in any script
 used on all those machines.  Without that you'd need to have some
 mean to detect the IPV6 support and change the wget switches used
 accordingly.

 Same thing for -6 in fact - leave the switch even if no IPV6 is
 present and supported, die with a meaningful error message (much
 better than a unknown switch failure).

In principle, I agree with this.  `-4' should be a no-op on an
IPv6-challenged Wget.

Note that, in the current code, it's not so easy to just disable a
switch or a `.wgetrc' command, but it's doable.  If someone wants to
work on this, please do.


Re: windows devel binary

2003-11-14 Thread Hrvoje Niksic
Herold Heiko [EMAIL PROTECTED] writes:

 Windows MSVC binary for current cvs at http://xoomer.virgilio.it/hherold/

 This is a bit of a Doctor, if I do this it hurts. - So don't do
 that!, but I think this should not happen:

 D:\Wip\Wget\wget.wip\srcwget -4
 Assertion failed: 0 = comind  comind  countof (commands), file init.c,
 line 589

You're right, it shouldn't.  (It happens only when IPv6 is disabled,
that's why I didn't see it.)

 This is a binary compiled and run on windows nt 4, which doesn't support
 IPV6, so the -4 should probably be a no-op ?

Or not work at all.

 As I said, shouldn't really be done, IPV6 code is in development and
 so on, so this is just a FYI.

Thanks for the report.  This patch should fix it:


2003-11-14  Hrvoje Niksic  [EMAIL PROTECTED]

* main.c: Enable -4 and -6 only if IPv6 is enabled.

Index: src/main.c
===
RCS file: /pack/anoncvs/wget/src/main.c,v
retrieving revision 1.100
diff -u -r1.100 main.c
--- src/main.c  2003/11/11 21:48:35 1.100
+++ src/main.c  2003/11/14 15:08:07
@@ -194,8 +194,10 @@
 { ignore-length, 0, OPT_BOOLEAN, ignorelength, -1 },
 { ignore-tags, 0, OPT_VALUE, ignoretags, -1 },
 { include-directories, 'I', OPT_VALUE, includedirectories, -1 },
+#ifdef ENABLE_IPV6
 { inet4-only, '4', OPT_BOOLEAN, inet4only, -1 },
 { inet6-only, '6', OPT_BOOLEAN, inet6only, -1 },
+#endif
 { input-file, 'i', OPT_VALUE, input, -1 },
 { keep-session-cookies, 0, OPT_BOOLEAN, keepsessioncookies, -1 },
 { level, 'l', OPT_VALUE, reclevel, -1 },
@@ -455,10 +457,12 @@
--dns-cache=off   disable caching DNS lookups.\n),
 N_(\
--restrict-file-names=OS  restrict chars in file names to ones OS allows.\n),
+#ifdef ENABLE_IPV6
 N_(\
   -4,  --inet4-only  connect only to IPv4 addresses.\n),
 N_(\
   -6,  --inet6-only  connect only to IPv6 addresses.\n),
+#endif
 \n,
 
 N_(\