Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Aug 1996 14:30:03 -0700 (PDT)
From:      "Jordan K. Hubbard" <jkh@time.cdrom.com>
To:        freebsd-bugs
Subject:   Re: bin/1557: pkg_add's auto dependency get .. doesn't work 
Message-ID:  <199608312130.OAA14413@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/1557; it has been noted by GNATS.

From: "Jordan K. Hubbard" <jkh@time.cdrom.com>
To: leonard@dstc.edu.au
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/1557: pkg_add's auto dependency get .. doesn't work 
Date: Sat, 31 Aug 1996 14:23:51 -0700

 > 	So, i looked into why the .tgz extension isn't being added in, and
 > 	added that (see patches to pkg_install/lib/file.c below) then
 > 	retried
 
 Genuine bug, thanks.
 
 > 	anyway, i traced this to a thing inside libftpio where with
 > 	ftpGetURL, an static FILE* is being closed on each re-open.
 > 
 > 	I suspect that the fclose done in ftpGetURL() is to avoid
 > 	exhausting file descriptors... anyway what i have now works,
 
 Erm, sort of. :-(
 
 That construct is very deliberately the way it is, due to the fact
 that when you open a connection to an FTP, that returns one FILE*.  If
 you then ask for a file from that connection, it returns another
 FILE*.  Now, and this is the important part, if you close the first
 file pointer before finishing with the second, you lose.  The intended
 use of ftpGetURL() was that you'd process the file it returned all the
 way to completion and close it before asking for another URL.  This is
 clearly not what pkg_add is doing, and pkg_add has a bug I'll have to
 look into.  Leaving leaks in libftpio is not an acceptable solution by
 any conceivable stretch.
 
 However, you have suggested an important optimization to me, and
 that's to cache the old host connection when getting ftpGetURL()
 requests back-to-back for the same host.  That just makes simple
 sense, and was easy to do.  I'll commit the changes shortly to
 libftpio, as well as some fixes to pkg_add.
 
 					Jordan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608312130.OAA14413>