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.
Add support for conditional GET using the 'i' flag. Inspired by
the HTTP support for the same feature in FreeBSD by Murray Stokely, but
mostly rewritten and extended to work for all protocols.
Change FTP backend to use passive mode by default and fallback to active
mode on syntax errors as discussed with and suggested by Luke Mewburn.
Retire 'p' now and introduce 'a' flag to get the old default behavior.
- only include openssl if the openssl option is present
- include arpa/inet.h to get ntohl and friends on older platforms like
Interix
- use new netdb.h compat code from libnbcompat
- include inttypes.h only when present
- don't name local variables err, Interix has a symbol like that in
default namespace
- allow fetch_read to do short read and do more intelligent buffering
for header processing; effectively don't do a system call for each
byte read
- remove most of the debug junk
- fix a buffer overflow in the config parser
- replace stdio usage with a simple abstract IO framework. currently
without explicit buffering, but that might be added later