[prev in list] [next in list] [prev in thread] [next in thread]
List: freebsd-bugs
Subject: Re: bin/1557: pkg_add's auto dependency get .. doesn't work
From: "Jordan K. Hubbard" <jkh () time ! cdrom ! com>
Date: 1996-08-31 21:30:03
[Download RAW message or body]
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic