When building with gcc4.7, libfetch fails with the following error:
ftp.c: In function 'unmappedaddr':
ftp.c:149:2: error: dereferencing type-punned pointer will break
strict-aliasing rules [-Werror=strict-aliasing]
cc1: all warnings being treated as errors
*** Error code 1
The code is intentionally grouping an array of four uint8_t bytes into a
uint32_t word. Add -Wno-strict-aliasing in makefile to fix build in gcc4.7.
Libfetch build failure with gcc 4.6 is due to the a couple of assigned
variables not getting used. This patch allows systems like Debian and
OpenIndiana to bootstrap pkgsrc.
PR 43013 by Brook Milligan: fetch(3) violates RFC 1738 for ftp:// URLs
if the home directory is not the root directory.
Remember the current directory the first time a CWD / CDUP has to be
issued. Use the document as full URL if the URL started with two /
(quoted or not), otherwise append it to the initial directory.
Revamp FTP connection cache. Move it to the common layer to be later
shared with HTTP (for persistent connection). The application controls
how much caching is desired. Drop the reference counting on connections.
Add a callback when the cached connection is dropped due to LRU.
Over all, this allows more than one session cached per host and sessions
cached to different servers.
The connection sharing didn't handle the case of active transfers
correctly and tried to close the connection in that case (PR 42607).
Correctly check if there is a transfer going on and just leave the
connection alone in that case.
Fix a bug in the line reading optimisation, which could get confused if
the byte following the new line is a NUL. Adresses Arch Linux problem
report #15845.
Do not reuse a FTP connection if there is currently a transfer active.
Some FTP servers hang on the NOOP command. Reported by Manuel Bouyer.