Missing asprintf()

2008-09-09 Thread Gisle Vanem
Why the need for asprintf() in url.c:903? This function is missing on DOS/Win32 and nowhere to be found in ./lib. I suggest we replace with this: --- hg-latest/src/url.c Tue Sep 09 12:37:23 2008 +++ url.c Tue Sep 09 13:01:33 2008 @@ -893,16 +893,18 @@ if (error_code ==

Where is program_name?

2008-09-09 Thread Gisle Vanem
'program_name' is used in lib/error.c, but it is not allocated anywhere. Should it be added to main.c and initialised to exec_name? --gv

Re: Missing asprintf()

2008-09-09 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] wrote: Wget is supposed to use aprintf, which is defined in utils.c, and is not specific to Unix. It's preferable to use an asprintf-like functions than a static buffer because it supports reentrance (unlike a static buffer) and imposes no arbitrary limits on

Re: Where is program_name?

2008-09-09 Thread Gisle Vanem
Google for that and you will find the corresponding man page. Like it's written here http://www.tin.org/bin/man.cgi?section=3topic=PROGRAM_INVOCATION_NAME These variables are automatically initialised by the glibc run-time startup code. I'm on Windows. So glibc is of no help here. --gv

test

2007-10-05 Thread Gisle Vanem
A loop-test; trouble with my subscription. --gv

Wget stuck after HEAD

2007-08-23 Thread Gisle Vanem
Resently I'm having problems with d/l from some sites using http. E.g.: wget -d http://lynx.isc.org/current/lynx2.8.7dev.7.tar.bz2 DEBUG output created by Wget 1.10+devel on Windows-MinGW. --14:42:04-- http://lynx.isc.org/current/lynx2.8.7dev.7.tar.bz2 Resolving lynx.isc.org... seconds 0.00,

Re: Wget stuck after HEAD

2007-08-23 Thread Gisle Vanem
Gisle Vanem [EMAIL PROTECTED] wrote: It seems there's an issue with the HEAD request. Maybe some servers doesn't like it? Can anybody on Win32 try the above url? It seems to be connected with this change: 2007-07-04 Mauro Tortonesi [EMAIL PROTECTED] * http.c (http_loop): Skip HEAD

Re: Wget stuck after HEAD

2007-08-23 Thread Gisle Vanem
Micah Cowan [EMAIL PROTECTED] wrote: My strong suspicion is that you're using the wrong repository? Spot on! I believe I asked dotsrc to remove the old one, I'll ping them again on that. Please do. --gv

login incorrect

2006-06-26 Thread Gisle Vanem
Consider this command and output: wget -d ftp://ftp.openssl.org/snapshot/openssl-SNAP-20060626.tar.gz DEBUG output created by Wget 1.11-alpha-1 on Windows-MinGW. --14:06:04-- ftp://ftp.openssl.org/snapshot/openssl-SNAP-20060626.tar.gz = `openssl-SNAP-20060626.tar.gz' Resolving

Re: Trying to use WGET as a poor mans proxy

2006-01-30 Thread Gisle Vanem
Bruso, John [EMAIL PROTECTED] wrote: I'm trying to get wget to go fetch a url like this: http://voap.weather.com/weather/oap/82801?template=GENXVpar=nullunit=0 key=63c4c2fa0cd55c5f42d6e20a7e56586f but, WGET isn't recognizing some of the parameters in the URL. Is it possible for WGET to

Re: Unifying Windows Makefiles

2005-07-08 Thread Gisle Vanem
Hrvoje Niksic wrote: 3. Add the redundant #ifdefs to all compilation-dependent C files to make sure that they are ignored when the libraries they require are missing. For example, openssl.c should be wrapped in #ifdef HAVE_OPENSSL. So should http-ntlm.c. But using GNU make it's pretty

Re: Unifying Windows Makefiles

2005-07-08 Thread Gisle Vanem
MSVC_OBJECTS = $(addprefix MSVC_obj/, $(SOURCE)) MINGW_OBJECTS = $(addprefix MingW_obj/, $(SOURCE)) Should off course be: MSVC_OBJECTS = $(addprefix MSVC_obj/, $(SOURCE:.c=.obj)) MINGW_OBJECTS = $(addprefix MingW_obj/, $(SOURCE:.c=.o)) MingW_obj/%.obj: %.c gcc -c $(MINGW_CFLAGS) -o $@ $

Re: Unifying Windows Makefiles

2005-07-08 Thread Gisle Vanem
Hrvoje Niksic wrote: Wouldn't you need to have separate targets for linking as well? Sure. That target would simply depend on $(MSVC_OBJECTS) etc.: wget-msvc.exe: $(MSVC_OBJECTS) link $(MSVC_LDFLAGS) -out:$@ $^ $(MSVC_EXT_LIBS) Possibly with an extra mv -f $@ $(INSTALL_DIR)/wget.exe.

Re: ftp bug in 1.10

2005-06-25 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] wrote: It should print a line containing 100. If it does, it means we're applying the wrong format. If it doesn't, then we must find another way of printing LARGE_INT quantities on Windows. I don't know what compiler OP used, but Wget only uses %I64

Large file problem

2005-02-27 Thread Gisle Vanem
It doesn't seem the patches to support 2GB files works on Windows. Wget hangs indefinitely at the end of transfer. E.g. \wget.exe ftp://ftp.ncbi.nih.gov/blast/db/FASTA/nt.gz --05:38:54-- ftp://ftp.ncbi.nih.gov/blast/db/FASTA/nt.gz = `nt.gz' Resolving ftp.ncbi.nih.gov... 130.14.29.30

Re: Large file problem

2005-02-27 Thread Gisle Vanem
Hrvoje Niksic wrote: Gisle Vanem [EMAIL PROTECTED] writes: It doesn't seem the patches to support 2GB files works on Windows. Wget hangs indefinitely at the end of transfer. Is there a way to trace what syscall Wget is stuck at? Under Cygwin I can try to use strace, but I'm not sure if I'll

Re: Large file support

2005-02-26 Thread Gisle Vanem
Hrvoje Niksic wrote: In other words, large files now work on Windows? I must admit, that was almost too easy. :-) Don't open the champagne bottle just yet :) Now could someone try this with Borland and/or Watcom and MingW? I'm pretty sure I broke them in some places, but it's near impossible to

Re: O_EXCL under Windows?

2005-02-25 Thread Gisle Vanem
Hrvoje Niksic wrote: Is there a way to get the functionality of open(..., O_CREAT|O_EXCL) under Windows? For those who don't know, O_EXCL opens the file exclusively, guaranteeing that the file we're opening will not be overwritten. (Note that it's not enough to check that the file doesn't exist

Re: Windows and long long

2005-02-20 Thread Gisle Vanem
Hrvoje Niksic wrote: Does MSVC support long long? If not, how does one... No, it has a '__int64' built-in. * print __int64 values? I assume printf(%lld, ...) doesn't work? Correct, use %I64d for signed 64-bit and %I64u for unsigned. * retrieve __int64 values from strings? I assume there is no

Re: Back after a while

2005-02-15 Thread Gisle Vanem
Hrvoje Niksic wrote: For the last several months I've been completely absent from Wget development, and from the net in general. Here is why, and the story is not for the faint of heart. Glad you're back and hope your health is getting better. The TODO list has grown a bit while you've been

Re: errno and Windows

2004-11-27 Thread Gisle Vanem
Wget incorrectly tests 'errno' after network calls on Windows. 'errno' is *not* set on failure. One must use WSAGetLastError() for this. I've added a SET/GET_ERRNO() macro to do this more portably. I sent this patch to Wget-patches a week ago, but heard nothing. Isn't there not anybody monitoring

Re: Cannot pass ampersand in URL?

2004-06-12 Thread Gisle Vanem
Phil Lewis [EMAIL PROTECTED] said: I have been trying to wget a URL with an ampersand (e.g.: http://search.yahoo.com/search?fr=slv1- http://search.yahoo.com/search?fr=slv1-ei=UTF-8p=wget ei=UTF-8p=wget). I substitute %26 for the ampersands, but wget does not download the page. Judging from

Re: Large Files Support for Wget

2004-05-08 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: #define FILE_OFF_T 32/64 bit unsigned Fair enough. But isn't off_t signed? Obs, yes. A 'long' on Win32. #define FILE_OFF_FMT %llu or %Lu How does gettext cope with that? For example, this string is what worries me: printf (_(The

non-ASCII in host names

2004-03-19 Thread Gisle Vanem
Trying to connect to hosts with non-ASCII in the name doesn't work. E.g. wget www.tromsø.no Resolving www.troms%f8.no... failed: Host not found. (ø = o with slash, oslash;) The host does in fact exist. I have to use the ACE form www.xn--troms-zua.no which is a bit of a pain. Ref.

Re: non-ASCII in host names

2004-03-19 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: If it where not for the Host: header, the name could remain un-escaped. I don't know what the standard say about this case. Should the header contain Host:www.xn--troms-zua.no ? The Host header is (I think) not URL-escaped, so we can simply send the

Windows titlebar fix

2004-03-02 Thread Gisle Vanem
ws_percenttitle() should not be called in quiet mode since ws_changetitle() AFAICS is only called in verbose mode. That caused an assert in mswindows.c. An easy patch: --- CVS-latest\src\retr.c Sun Dec 14 14:35:27 2003 +++ src\retr.c Tue Mar 02 21:18:55 2004 @@ -311,7 +311,7 @@ if

Re: Windows titlebar fix

2004-03-02 Thread Gisle Vanem
We could also fix this by calling ws_changetitle() unconditionally. Should the title bar be affected by verbosity? IMHO yes, Quiet is quiet. --gv

Re: fork_to_background() on Windows

2003-12-20 Thread Gisle Vanem
The shell is smart enough to run those 2 commands in series. If wget is a GUI app, it runs them in parallell causing gzip to fail. wget -O- http://host/index.html | most works kind of; only some of the stdout data gets displayed. I've searched google and the only way AFAICS to get

fork_to_background() on Windows

2003-12-19 Thread Gisle Vanem
The fork-to-background on Windows is just a joke (as the comment in config.h.mingw says). Is anybody using it? It could be a useful feature if we attach to the console of calling process (the shell in most cases) at startup. Then when ^Break is pressed (or '-b' specified), we free that console

Re: fork_to_background() on Windows

2003-12-19 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: Making `-b' work would be great. But is it really desirable for ctrl-break to put Wget in background? I thought ctrl-break was supposed to interrupt and abort the program, like ^C on Unix? Hmm, now I see that ctrl-break backgrounds Wget even now, so I

Re: Using a proxy from command line under win32?

2003-12-07 Thread Gisle Vanem
Jago Pearce [EMAIL PROTECTED] said: The documentation is a bit unclear, an example would help because at the moment I'm trying wget http://www.foo.com/[EMAIL PROTECTED]:3128 Which isn't working. Do you *always* need to use a HTTP proxy? If so you can put this in your '.wgetrc' file:

Recursive ftp

2003-12-07 Thread Gisle Vanem
Some minor issues with recursive ftp. If all extensions are rejected (no file in .listing are accepted), Wget still issues a PORT and an empty RETR command. Is this WAD (working as designed)? E.g. wget -r -Ahtm ftp://host/foo/ when I really intended -Ahtml It would be nice if Wget could say

Re: Recursive ftp broken

2003-11-26 Thread Gisle Vanem
Interestingly, I can't repeat this. Still, to be on the safe side, I added some additional restraints to the code that make it behave more like the previous code, that worked. Please try again and see if it works now. If not, please provide some form of debugging output as well. This

Recursive ftp broken

2003-11-22 Thread Gisle Vanem
I don't know when it happened, but latest CVS version breaks recursive ftp download. I tried with this: wget -rAZIP ftp://ftp.mpoli.fi/pub/software/DOS/NETWORK/ and the result is: --20:46:02-- ftp://ftp.mpoli.fi/pub/software/DOS/NETWORK/ =

Re: ipv6 patch

2003-11-19 Thread Gisle Vanem
Herold Heiko [EMAIL PROTECTED] said: Attached a little patch needed for current cvs in order to compile on windows nt 4 (any system without IPV6 really). FYI, Wget/IPv6 on Windows do work somewhat; getaddrinfo() is able to resolve a host to it's IPv6 address(es). But getnameinfo() isn't able

Re: ipv6 patch

2003-11-19 Thread Gisle Vanem
but Wget doesn't check return value of inet_ntop(). Hint hint. I wasn't aware that inet_ntop could really fail. Why did getaddrinfo return the address if I can't print it? getaddrinfo() on Win-XP seems to be a thin wrapper over the DNS client which resolves records fine. But

Re: Translations for 1.9.1

2003-11-17 Thread Gisle Vanem
Manfred Schwarb [EMAIL PROTECTED] said: But on my machine, translations are broken somehow, all special characters are scrambled. With wget 1.9 this didn't happen. Example from de.po: #: src/convert.c:439 #, c-format msgid Cannot back up %s as %s: %s\n msgstr Anlegen eines Backups von %s

--inet6-only option

2003-11-15 Thread Gisle Vanem
MingW version compiled with ENABLE_IPV6, HAVE_GETADDRINFO etc. but no HAVE_GETADDRINFO_AI_ADDRCONFIG. Running wget -6 url.. on a machine with no IPv6 installed silently uses IPv4. A warning with fallback to IPv4 is IMHO okay. Or an exit? Not sure about the rationale behind '--inet6-only', but

gettext and charsets

2003-11-04 Thread Gisle Vanem
This should go to the gettext people, but I couldn't find any mailing list. I've built Wget with NLS support on Win-XP, but the display char-set is wrong. Built with LOCALEDIR=g:/MingW32/share BTW. This is IMHO so ugly. Shouldn't there be a way to set this at runtime (as Lynx does). E.g. have a

Re: gettext and charsets

2003-11-04 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: I'm not sure about the charset issues on Windows. Does gettext detect the presence of GNU iconv? (I assume you have the latter if you have the `iconv' command.) libintl depends on libiconv: cygcheck wget.exe .. f:\windows\System32\libintl-2.dll

accept() error

2003-11-01 Thread Gisle Vanem
In some ftp downloads I occationally see the error accept: Timed out Retrying immediately and then hanging in the PORT command for a long time. Studying the code, I can understand why: uerr_t acceptport (int *sock) { struct sockaddr_storage ss; struct sockaddr *sa = (struct sockaddr *)ss;

Re: errno patches for Windows

2003-10-16 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: OK. So the whole thing with errno is only necessary when dealing with Winsock errors. For errors from, say, fopen it's fine to use errno? Yes. There is another possible approach. We already #define read and write to call Winsock stuff. We could add

Re: errno patches for Windows

2003-10-16 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: #ifdef WINDOWS # define select(a, b, c, d) windows_select (a, b, c, d) #endif Okay by me. #ifndef ENOTCONN # define ENOTCONN X_ENOTCONN #endif Except you cannot make Winsock return X_ENOTCONN. It returns WSAENOTCONN (def'ed to ENOTCONN in

Re: Error in wget-1.9-b5.zip

2003-10-15 Thread Gisle Vanem
Error in wget-1.9-b5.zip wget cannot find the host. Turn on -d option and observe: Location: http://www.yourworstenemy.com?tgpid=008drefid=393627 [following] Closing fd 1952 --13:38:35-- http://www.yourworstenemy.com/?tgpid=008drefid=393627 = `tmp2/www.yourworstenemy.com/[EMAIL

Re: Error in wget-1.9-b5.zip

2003-10-15 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: Note that David's Wget seems to have printed unknown error, not Host not found. Is that an artifact of his version of system libraries, or is Wget doing something wrong? I don't know how/when Windows could print anything else what's already in

Re: Error in wget-1.9-b5.zip

2003-10-15 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: Note that David's Wget seems to have printed unknown error, not Host not found. Is that an artifact of his version of system libraries, or is Wget doing something wrong? That's because wget incorrectly uses strerror() for Winsock errors or uses 'errno'

touch() on Windows

2003-10-13 Thread Gisle Vanem
It seems touch() is called on an open file and hence utime() is either silently ignored or causing Access denied on Watcom. I added this inside touch(): DEBUGP ((touching %s to %.24s\n, file, asctime(localtime(tm; And ran: wget -d -Otcpdump.tgz

Re: touch() on Windows

2003-10-13 Thread Gisle Vanem
It seems touch() is called on an open file and hence utime() is either silently ignored or causing Access denied on Watcom. Correction; Watcom says Permission denied. --gv

Re: touch() on Windows

2003-10-13 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: Wget already has code that closes and reopens output document if it's a regular file. Perhaps the same should be done here... Allthough IE or other browsers doesn't seems to do it, I think it would be a good thing to honour the Last-Modified header on

Re: Bug in Windows binary?

2003-10-05 Thread Gisle Vanem
Jens Rsner [EMAIL PROTECTED] said: I downloaded wget 1.9 beta 2003/09/29 from Heiko http://xoomer.virgilio.it/hherold/ ... wget -d http://www.google.com DEBUG output created by Wget 1.9-beta on Windows. set_sleep_mode(): mode 0x8001, rc 0x8000 I disabled my wgetrc as well and the

mswindows.h patch

2003-10-03 Thread Gisle Vanem
Regarding my run_with_timeout() patch, I forgot the following patch to mswindows.h (which isnt included in util.c). In my forthcoming patches for IPv6, we need to use the correct Winsock headers. To avoid ifdef clutter throughout the .c-files, I've put them in mswindows.h. So the .c-files

run_with_timeout() for Windows

2003-10-02 Thread Gisle Vanem
I've patched util.c to make run_with_timeout() work on Windows (better than it does with alarm()!). In short it creates and starts a thread, then loops querying the thread exit-code. breaks if != STLL_ACTIVE, else sleep for 0.1 sec. Uses a wget_timer too for added accuracy. Tested with

Re: run_with_timeout() for Windows

2003-10-02 Thread Gisle Vanem
Forgot this in src/Changelog: 2003-10-02 Gisle Vanem [EMAIL PROTECTED] * utils.c (run_with_timeout): For Windows: Run the 'fun' in a thread via a helper function. Continually query the thread's exit-code until finished or timed out. PS.: +static DWORD

Re: run_with_timeout() for Windows

2003-10-02 Thread Gisle Vanem
Hrvoje Niksic [EMAIL PROTECTED] said: I've committed this patch, with minor changes, such as moving the code to mswindows.c. Since I don't have MSVC, someone else will need to check that the code compiles. Please let me know how it goes. It compiled it with MSVC okay, but crashed somewhere

Windows titlebar patch

2003-09-29 Thread Gisle Vanem
I've made a patch to show percentage downloaded in addition to URL in the titlebar. Real handy IMHO on minimised windows sitting in the bottom toolbar. 2003-09-26 Gisle Vanem [EMAIL PROTECTED] * src/mswindows.c: Added ws_percenttitle() showing progress in the window titlebar. Called from

Windows patches

2003-09-26 Thread Gisle Vanem
Some more patches for wget on Windows. 1) config.h.ms: DMC already have usleep() and sleep(). 2) mswindows.c: - Removed read_registry() as it's not needed. - Added set_sleep_mode() to prevent Windows entering sleep-mode or hibernation on long transfers. Console mode programs

Re: Capture HTML Stream

2003-07-09 Thread Gisle Vanem
Aaron S. Hawley [EMAIL PROTECTED] said: but wget could do wget -O /dev/stdout www.washpost.com On DOS/Windows too? I think not. There must be a better way. --gv

Preventing sleep modeon long tranfers

2003-01-06 Thread Gisle Vanem
Hi, How can wget (or some other program) prevent Win-XP from going into sleep-mode (or hibernation) on long transfers (recursive or mirroring d/l). I've set sleep-mode to activate after 15 min. But must disable it when I suspect the d/l to take longer time (--continue doesn't always work).