OT: wget bug

Joe R. Jah jjah at cloud.ccsf.cc.ca.us
Fri Jul 17 22:12:33 UTC 2009


Hello all,

I want to wget a site at regular intervals and only get the updated pages,
so I use the this wget command line:

wget -b -m -nH http://host.domain/Directory/file.html

It works fine on the first try, but it fails on subsequent tries with the
following error message:

--8<--
Connecting to host.domain ... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.
--8<--

I can change directory from which to run wget every time, but that defeats
the purpose of downloading only the changed files.

I googled "wget fails on second try" and found this small patch in a Linux
group that should supposedly fix the problem:

--8<--
--- wget-1.10.2/src/ftp.c.cwd   2006-12-03 13:23:08.801467652 +0100
+++ wget-1.10.2/src/ftp.c       2006-12-03 20:30:24.641876672 +0100
@@ -1172,7 +1172,7 @@
        len = 0;
       err = getftp (u, &len, restval, con);

-      if (con->csock != -1)
+      if (con->csock == -1)
        con->st &= ~DONE_CWD;
       else
        con->st |= DONE_CWD;
--8<--

My wget is the latest version in the ports, 1.11.4.

Any ideas or advise is greatly appreciated.

Regards,

Joe
-- 
     _/   _/_/_/       _/              ____________    __o
     _/   _/   _/      _/         ______________     _-\<,_
 _/  _/   _/_/_/   _/  _/                     ......(_)/ (_)
  _/_/ oe _/   _/.  _/_/ ah        jjah at cloud.ccsf.cc.ca.us


More information about the freebsd-questions mailing list