From owner-freebsd-questions@FreeBSD.ORG Sat Jul 18 00:51:10 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D3FE1065670 for ; Sat, 18 Jul 2009 00:51:10 +0000 (UTC) (envelope-from jjah@cloud.ccsf.cc.ca.us) Received: from cloud.ccsf.cc.ca.us (cloud.ccsf.cc.ca.us [147.144.1.212]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB968FC1B for ; Sat, 18 Jul 2009 00:51:10 +0000 (UTC) (envelope-from jjah@cloud.ccsf.cc.ca.us) Received: from cloud.ccsf.cc.ca.us (localhost.ccsf.cc.ca.us [127.0.0.1]) by cloud.ccsf.cc.ca.us (8.14.2/8.14.2) with ESMTP id n6I0pA54061339; Fri, 17 Jul 2009 17:51:10 -0700 (PDT) (envelope-from jjah@cloud.ccsf.cc.ca.us) Received: from localhost (jjah@localhost) by cloud.ccsf.cc.ca.us (8.14.2/8.14.2/Submit) with ESMTP id n6I0pAIg061336; Fri, 17 Jul 2009 17:51:10 -0700 (PDT) (envelope-from jjah@cloud.ccsf.cc.ca.us) Date: Fri, 17 Jul 2009 17:51:10 -0700 (PDT) From: "Joe R. Jah" To: John Nielsen In-Reply-To: <200907171852.46730.lists@jnielsen.net> Message-ID: <20090717174420.W60749@cloud.ccsf.cc.ca.us> References: <20090717144049.C35992@cloud.ccsf.cc.ca.us> <200907171852.46730.lists@jnielsen.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org Subject: Re: OT: wget bug X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2009 00:51:10 -0000 On Fri, 17 Jul 2009, John Nielsen wrote: > Date: Fri, 17 Jul 2009 18:52:46 -0400 > From: John Nielsen > To: freebsd-questions@freebsd.org > Cc: Joe R. Jah > Subject: Re: OT: wget bug > > On Friday 17 July 2009 06:12:33 pm Joe R. Jah wrote: > > 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. > > I can't tell if your patch has already been applied upstream or if it's > a "reverse" patch. The current distfile matches the "+++" version at line > 1185. (normally the "+++" file is the new version but it's easy to get > the order reversed if you're not used to running diff). > > You could always just try the patch. Something along the lines of this: > > cd /usr/ports/ftp/wget > make clean > make patch #extract the distfiles and apply FreeBSD patches > cd work/wget-1.11.4/src > vi ftp.c #or any editor you like > ...go to line 1185 and change "==" to "!=" > ...save and quit the editor > cd /usr/ports/ftp/wget > make > make deinstall && make reinstall > ... try your procedure again. > > If you don't like the results a "make clean" will erase your (modified) > work directory and you can build the original version again. Thank you John. That was a simple procedure, but unfortunately the patch did not fix the problem. Regards, Joe -- _/ _/_/_/ _/ ____________ __o _/ _/ _/ _/ ______________ _-\<,_ _/ _/ _/_/_/ _/ _/ ......(_)/ (_) _/_/ oe _/ _/. _/_/ ah jjah@cloud.ccsf.cc.ca.us